summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/dialogs
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-11-25 01:00:25 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-11-25 11:30:04 +0100
commit58c69df4d38324644bc49ec5f42ee8343a454b2d (patch)
treede0a1ce603292dcaff134d4e1e8ab064295515a2 /tests/auto/widgets/dialogs
parent03b1d2c44940322208c12c7bceee376b51d8e852 (diff)
parent59a705e3710b0ba93bb698e3223241cfac932948 (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Conflicts: src/corelib/tools/qhash.h src/gui/kernel/qevent.h src/widgets/kernel/qshortcut.cpp src/widgets/kernel/qshortcut.h Change-Id: If61c206ee43ad1d97f5b07f58ac93c4583ce5620
Diffstat (limited to 'tests/auto/widgets/dialogs')
-rw-r--r--tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp16
-rw-r--r--tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp1
2 files changed, 8 insertions, 9 deletions
diff --git a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp
index f910b12cc6..7398cc103e 100644
--- a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp
+++ b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp
@@ -1030,15 +1030,13 @@ void tst_QFileSystemModel::dirsBeforeFiles()
// Wait for model to be notified by the file system watcher
QTRY_COMPARE(model->rowCount(root), 2 * itemCount);
- // ensure that no file occurs before a directory
- for (int i = 0; i < model->rowCount(root); ++i) {
+ // Ensure that no file occurs before any directory:
+ for (int i = 1; i < model->rowCount(root); ++i) {
#ifndef Q_OS_MAC
- QVERIFY(i == 0 ||
- !(model->fileInfo(model->index(i - 1, 0, root)).isFile()
+ QVERIFY(!(model->fileInfo(model->index(i - 1, 0, root)).isFile()
&& model->fileInfo(model->index(i, 0, root)).isDir()));
#else
- QVERIFY(i == 0 ||
- model->fileInfo(model->index(i - 1, 0, root)).fileName() <
+ QVERIFY(model->fileInfo(model->index(i - 1, 0, root)).fileName() <
model->fileInfo(model->index(i, 0, root)).fileName());
#endif
}
@@ -1048,7 +1046,7 @@ void tst_QFileSystemModel::roleNames_data()
{
QTest::addColumn<int>("role");
QTest::addColumn<QByteArray>("roleName");
- QTest::newRow("decoration") << int(Qt::DecorationRole) << QByteArray("decoration");
+ QTest::newRow("decoration") << int(Qt::DecorationRole) << QByteArray("fileIcon");
QTest::newRow("display") << int(Qt::DisplayRole) << QByteArray("display");
QTest::newRow("fileIcon") << int(QFileSystemModel::FileIconRole) << QByteArray("fileIcon");
QTest::newRow("filePath") << int(QFileSystemModel::FilePathRole) << QByteArray("filePath");
@@ -1065,8 +1063,8 @@ void tst_QFileSystemModel::roleNames()
QVERIFY(roles.contains(role));
QFETCH(QByteArray, roleName);
- QList<QByteArray> values = roles.values(role);
- QVERIFY(values.contains(roleName));
+ QCOMPARE(roles.values(role).count(), 1);
+ QCOMPARE(roles.value(role), roleName);
}
static inline QByteArray permissionRowName(bool readOnly, int permission)
diff --git a/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp b/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp
index 83bb4dc08f..f5358ceb93 100644
--- a/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp
+++ b/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp
@@ -228,6 +228,7 @@ void tst_QFontDialog::qtbug_41513_stylesheetStyle()
// The fontdialog sets the styleName, when the fontdatabase knows the style name.
resultFont.setStyleName(testFont.styleName());
+ testFont.setFamilies(QStringList(testFont.family()));
QCOMPARE(resultFont, testFont);
// reset stylesheet