Merge remote-tracking branch 'origin/5.13' into dev

Change-Id: Icc80dacbca8613f2996be75553ff15d0ad242b7e
This commit is contained in:
Qt Forward Merge Bot 2019-08-15 01:00:50 +02:00
commit 425d34b70e
20 changed files with 105405 additions and 28 deletions

View File

@ -14,6 +14,8 @@ load(device_config)
QMAKE_CFLAGS += -s WASM_OBJECT_FILES=$$WASM_OBJECT_FILES
QMAKE_CXXFLAGS += -s WASM_OBJECT_FILES=$$WASM_OBJECT_FILES
QMAKE_LFLAGS += -s WASM_OBJECT_FILES=$$WASM_OBJECT_FILES
} else {
EMCC_COMMON_LFLAGS += -s \"BINARYEN_TRAP_MODE=\'clamp\'\"
}
EMTERP_FLAGS = \
@ -29,8 +31,7 @@ EMCC_COMMON_LFLAGS = \
-s USE_WEBGL2=1 \
-s NO_EXIT_RUNTIME=0 \
-s ERROR_ON_UNDEFINED_SYMBOLS=1 \
--bind \
-s \"BINARYEN_TRAP_MODE=\'clamp\'\"
--bind
# The -s arguments can also be used with release builds,
# but are here in debug for clarity.

View File

@ -4544,7 +4544,7 @@ void blend_color_generic_rgb64(int count, const QSpan *spans, void *userData)
while (count--) {
int x = spans->x;
int length = spans->len;
if (solidFill && bpp >= QPixelLayout::BPP8 && spans->coverage == 255 && length) {
if (solidFill && bpp >= QPixelLayout::BPP8 && spans->coverage == 255 && length && op.destStore64) {
// If dest doesn't matter we don't need to bother with blending or converting all the identical pixels
op.destStore64(data->rasterBuffer, x, spans->y, &color, 1);
spanfill_from_first(data->rasterBuffer, bpp, x, spans->y, length);

View File

@ -727,6 +727,11 @@ void QPrintDialogPrivate::selectPrinter(const QPrinter::OutputFormat outputForma
else
options.pageSetCombo->setEnabled(true);
// Disable complex page ranges widget when printing to pdf
// It doesn't work since it relies on cups to do the heavy lifting and cups
// is not used when printing to PDF
options.pagesRadioButton->setEnabled(outputFormat != QPrinter::PdfFormat);
#if QT_CONFIG(cups)
// Disable color options on main dialog if not printing to file, it will be handled by CUPS advanced dialog
options.colorMode->setVisible(outputFormat == QPrinter::PdfFormat);

View File

@ -3186,14 +3186,18 @@ void QTableView::sortByColumn(int column)
/*!
\since 4.2
Sorts the model by the values in the given \a column in the given \a order.
Sorts the model by the values in the given \a column and \a order.
\a column may be -1, in which case no sort indicator will be shown
and the model will return to its natural, unsorted order. Note that not
all models support this and may even crash in this case.
\sa sortingEnabled
*/
void QTableView::sortByColumn(int column, Qt::SortOrder order)
{
Q_D(QTableView);
if (column < 0)
if (column < -1)
return;
// If sorting is enabled it will emit a signal connected to
// _q_sortIndicatorChanged, which then actually sorts

View File

@ -2619,7 +2619,7 @@ void QTreeView::sortByColumn(int column)
/*!
\since 4.2
Sets the model up for sorting by the values in the given \a column and \a order.
Sorts the model by the values in the given \a column and \a order.
\a column may be -1, in which case no sort indicator will be shown
and the model will return to its natural, unsorted order. Note that not
@ -2630,7 +2630,7 @@ void QTreeView::sortByColumn(int column)
void QTreeView::sortByColumn(int column, Qt::SortOrder order)
{
Q_D(QTreeView);
if (column < 0)
if (column < -1)
return;
// If sorting is enabled it will emit a signal connected to
// _q_sortIndicatorChanged, which then actually sorts

View File

@ -75,12 +75,14 @@ public:
UnfilteredPopupCompletion,
InlineCompletion
};
Q_ENUM(CompletionMode)
enum ModelSorting {
UnsortedModel = 0,
CaseSensitivelySortedModel,
CaseInsensitivelySortedModel
};
Q_ENUM(ModelSorting)
QCompleter(QObject *parent = nullptr);
QCompleter(QAbstractItemModel *model, QObject *parent = nullptr);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -85,6 +85,8 @@ private slots:
void testRasterARGB8565PM();
void testRasterGrayscale8_data();
void testRasterGrayscale8();
void testRasterRGBA64PM_data();
void testRasterRGBA64PM();
#ifndef QT_NO_OPENGL
void testOpenGL_data();
@ -226,6 +228,17 @@ void tst_Lancelot::testRasterGrayscale8()
}
void tst_Lancelot::testRasterRGBA64PM_data()
{
setupTestSuite();
}
void tst_Lancelot::testRasterRGBA64PM()
{
runTestSuite(Raster, QImage::Format_RGBA64_Premultiplied);
}
#ifndef QT_NO_OPENGL
bool tst_Lancelot::checkSystemGLSupport()
{

View File

@ -4257,32 +4257,42 @@ void tst_QTableView::task191545_dragSelectRows()
void tst_QTableView::task234926_setHeaderSorting()
{
QStringListModel model;
QStringList data;
data << "orange" << "apple" << "banana" << "lemon" << "pumpkin";
QSortFilterProxyModel sfpm; // default QStandardItemModel does not support 'unsorted' state
sfpm.setSourceModel(&model);
const QStringList data({"orange", "apple", "banana", "lemon", "pumpkin"});
QStringList sortedDataA = data;
QStringList sortedDataD = data;
std::sort(sortedDataA.begin(), sortedDataA.end());
std::sort(sortedDataD.begin(), sortedDataD.end(), std::greater<QString>());
model.setStringList(data);
QTableView view;
view.setModel(&model);
// view.show();
view.setModel(&sfpm);
QTRY_COMPARE(model.stringList(), data);
view.setSortingEnabled(true);
view.sortByColumn(0, Qt::AscendingOrder);
QTRY_COMPARE(model.stringList() , sortedDataA);
for (int i = 0; i < sortedDataA.size(); ++i)
QCOMPARE(view.model()->data(view.model()->index(i, 0)).toString(), sortedDataA.at(i));
view.horizontalHeader()->setSortIndicator(0, Qt::DescendingOrder);
QTRY_COMPARE(model.stringList() , sortedDataD);
for (int i = 0; i < sortedDataD.size(); ++i)
QCOMPARE(view.model()->data(view.model()->index(i, 0)).toString(), sortedDataD.at(i));
QHeaderView *h = new QHeaderView(Qt::Horizontal);
h->setModel(&model);
view.setHorizontalHeader(h);
h->setSortIndicator(0, Qt::AscendingOrder);
QTRY_COMPARE(model.stringList() , sortedDataA);
for (int i = 0; i < sortedDataA.size(); ++i)
QCOMPARE(view.model()->data(view.model()->index(i, 0)).toString(), sortedDataA.at(i));
h->setSortIndicator(0, Qt::DescendingOrder);
QTRY_COMPARE(model.stringList() , sortedDataD);
for (int i = 0; i < sortedDataD.size(); ++i)
QCOMPARE(view.model()->data(view.model()->index(i, 0)).toString(), sortedDataD.at(i));
view.sortByColumn(-1, Qt::AscendingOrder);
QCOMPARE(view.horizontalHeader()->sortIndicatorSection(), -1);
for (int i = 0; i < data.size(); ++i)
QCOMPARE(view.model()->data(view.model()->index(i, 0)).toString(), data.at(i));
}
void tst_QTableView::taskQTBUG_5062_spansInconsistency()

View File

@ -2783,6 +2783,8 @@ void tst_QTreeView::sortByColumn()
QFETCH(bool, sortingEnabled);
QTreeView view;
QStandardItemModel model(4,2);
QSortFilterProxyModel sfpm; // default QStandardItemModel does not support 'unsorted' state
sfpm.setSourceModel(&model);
model.setItem(0, 0, new QStandardItem("b"));
model.setItem(1, 0, new QStandardItem("d"));
model.setItem(2, 0, new QStandardItem("c"));
@ -2793,15 +2795,28 @@ void tst_QTreeView::sortByColumn()
model.setItem(3, 1, new QStandardItem("f"));
view.setSortingEnabled(sortingEnabled);
view.setModel(&model);
view.setModel(&sfpm);
view.sortByColumn(1, Qt::DescendingOrder);
QCOMPARE(view.header()->sortIndicatorSection(), 1);
QCOMPARE(view.model()->data(view.model()->index(0, 0)).toString(), QString::fromLatin1("c"));
QCOMPARE(view.model()->data(view.model()->index(1, 0)).toString(), QString::fromLatin1("d"));
QCOMPARE(view.model()->data(view.model()->index(0, 1)).toString(), QString::fromLatin1("h"));
QCOMPARE(view.model()->data(view.model()->index(1, 1)).toString(), QString::fromLatin1("g"));
view.sortByColumn(0, Qt::AscendingOrder);
QCOMPARE(view.header()->sortIndicatorSection(), 0);
QCOMPARE(view.model()->data(view.model()->index(0, 0)).toString(), QString::fromLatin1("a"));
QCOMPARE(view.model()->data(view.model()->index(1, 0)).toString(), QString::fromLatin1("b"));
QCOMPARE(view.model()->data(view.model()->index(0, 1)).toString(), QString::fromLatin1("f"));
QCOMPARE(view.model()->data(view.model()->index(1, 1)).toString(), QString::fromLatin1("e"));
view.sortByColumn(-1, Qt::AscendingOrder);
QCOMPARE(view.header()->sortIndicatorSection(), -1);
QCOMPARE(view.model()->data(view.model()->index(0, 0)).toString(), QString::fromLatin1("b"));
QCOMPARE(view.model()->data(view.model()->index(1, 0)).toString(), QString::fromLatin1("d"));
QCOMPARE(view.model()->data(view.model()->index(0, 1)).toString(), QString::fromLatin1("e"));
QCOMPARE(view.model()->data(view.model()->index(1, 1)).toString(), QString::fromLatin1("g"));
}
/*