summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/widgets')
-rw-r--r--tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp10
-rw-r--r--tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp1
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp23
3 files changed, 28 insertions, 6 deletions
diff --git a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp
index 3f67b0e1b4..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
}
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
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
index c29d1bbe04..3f2b8bca13 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
@@ -401,6 +401,7 @@ private slots:
void tabletTracking();
void closeEvent();
+ void closeWithChildWindow();
private:
bool ensureScreenSize(int width, int height);
@@ -11173,5 +11174,27 @@ void tst_QWidget::closeEvent()
QCOMPARE(widget.closeCount, 1);
}
+void tst_QWidget::closeWithChildWindow()
+{
+ QWidget widget;
+ auto childWidget = new QWidget(&widget);
+ childWidget->setAttribute(Qt::WA_NativeWindow);
+ childWidget->windowHandle()->create();
+ widget.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&widget));
+ widget.windowHandle()->close();
+ widget.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&widget));
+ // Check that the child window inside the window is now visible
+ QVERIFY(childWidget->isVisible());
+
+ // Now explicitly hide the childWidget
+ childWidget->hide();
+ widget.windowHandle()->close();
+ widget.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&widget));
+ QVERIFY(!childWidget->isVisible());
+}
+
QTEST_MAIN(tst_QWidget)
#include "tst_qwidget.moc"