diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-10-24 12:48:39 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-10-24 12:48:42 +0200 |
commit | 840f6a40e6218992b5b9d451ee3c0886a4846c89 (patch) | |
tree | 2b808decc7adf5218b810d2de6b45c5a8b4cfc42 /tests/auto/widgets/dialogs | |
parent | 109bf980b37fed405c6c1eb14cb9c83ff897e389 (diff) | |
parent | 2e3870fe37d36ccf4bd84eb90e1d5e08ad00c1bc (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Change-Id: Ie56539b2e0be611a363b5f15ae5412a78d6945a2
Diffstat (limited to 'tests/auto/widgets/dialogs')
3 files changed, 39 insertions, 2 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() diff --git a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp index e24a1dfc96..816d375b97 100644 --- a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp +++ b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp @@ -115,6 +115,7 @@ private slots: void sort(); void mkdir(); + void deleteFile(); void caseSensitivity(); @@ -934,6 +935,25 @@ void tst_QFileSystemModel::mkdir() QCOMPARE(oldRow, idx.row()); } +void tst_QFileSystemModel::deleteFile() +{ + QString newFilePath = QDir::temp().filePath("NewFileDeleteTest"); + QFile newFile(newFilePath); + if (newFile.exists()) { + if (!newFile.remove()) + qWarning() << "unable to remove" << newFilePath; + QTest::qWait(WAITTIME); + } + if (!newFile.open(QIODevice::WriteOnly | QIODevice::Text)) { + qWarning() << "unable to create" << newFilePath; + } + newFile.close(); + QModelIndex idx = model->index(newFilePath); + QVERIFY(idx.isValid()); + QVERIFY(model->remove(idx)); + QVERIFY(!newFile.exists()); +} + void tst_QFileSystemModel::caseSensitivity() { QString tmp = flatDirTestPath; diff --git a/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp b/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp index c240b5eb35..4506d0af14 100644 --- a/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp +++ b/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp @@ -439,7 +439,7 @@ void tst_QWizard::setPixmap() QVERIFY(wizard.pixmap(QWizard::BannerPixmap).isNull()); QVERIFY(wizard.pixmap(QWizard::LogoPixmap).isNull()); QVERIFY(wizard.pixmap(QWizard::WatermarkPixmap).isNull()); -#ifdef Q_OS_MACX +#ifdef Q_OS_OSX QVERIFY(wizard.pixmap(QWizard::BackgroundPixmap).isNull() == false); #else QVERIFY(wizard.pixmap(QWizard::BackgroundPixmap).isNull()); @@ -448,7 +448,7 @@ void tst_QWizard::setPixmap() QVERIFY(page->pixmap(QWizard::BannerPixmap).isNull()); QVERIFY(page->pixmap(QWizard::LogoPixmap).isNull()); QVERIFY(page->pixmap(QWizard::WatermarkPixmap).isNull()); -#ifdef Q_OS_MACX +#ifdef Q_OS_OSX QVERIFY(wizard.pixmap(QWizard::BackgroundPixmap).isNull() == false); #else QVERIFY(page->pixmap(QWizard::BackgroundPixmap).isNull()); |