summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp')
-rw-r--r--tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
index 81b69f6b89..8bad4bb176 100644
--- a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
+++ b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
@@ -66,6 +66,8 @@
#include <private/qfilesystemmodel_p.h>
#include <private/qfiledialog_p.h>
#endif
+#include <private/qguiapplication_p.h>
+#include <qpa/qplatformtheme.h>
#include <QFileDialog>
#include <QFileSystemModel>
@@ -145,6 +147,7 @@ private slots:
void clearLineEdit();
void enableChooseButton();
void hooks();
+ void widgetlessNativeDialog();
#ifdef Q_OS_UNIX
#ifdef QT_BUILD_INTERNAL
void tildeExpansion_data();
@@ -1396,6 +1399,20 @@ void tst_QFiledialog::hooks()
QCOMPARE(QFileDialog::getSaveFileUrl(), QUrl("http://saveUrl"));
}
+void tst_QFiledialog::widgetlessNativeDialog()
+{
+ if (!QGuiApplicationPrivate::platformTheme()->usePlatformNativeDialog(QPlatformTheme::FileDialog))
+ QSKIP("This platform always uses widgets to realize its QFileDialog, instead of the native file dialog.");
+ QFileDialog fd;
+ fd.setWindowModality(Qt::ApplicationModal);
+ fd.show();
+ QTRY_VERIFY(fd.isVisible());
+ QFileSystemModel *model = fd.findChild<QFileSystemModel*>("qt_filesystem_model");
+ QVERIFY(!model);
+ QPushButton *button = fd.findChild<QPushButton*>();
+ QVERIFY(!button);
+}
+
#ifdef Q_OS_UNIX
#ifdef QT_BUILD_INTERNAL
void tst_QFiledialog::tildeExpansion_data()