summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/dialogs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/widgets/dialogs')
-rw-r--r--tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp6
-rw-r--r--tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp10
-rw-r--r--tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp2
-rw-r--r--tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp2
4 files changed, 11 insertions, 9 deletions
diff --git a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
index 741b5e8aae..c9aef497af 100644
--- a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
+++ b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
@@ -1026,17 +1026,17 @@ void tst_QFiledialog::viewMode()
void tst_QFiledialog::proxymodel()
{
QFileDialog fd;
- QCOMPARE(fd.proxyModel(), (QAbstractProxyModel*)0);
+ QCOMPARE(fd.proxyModel(), nullptr);
fd.setProxyModel(0);
- QCOMPARE(fd.proxyModel(), (QAbstractProxyModel*)0);
+ QCOMPARE(fd.proxyModel(), nullptr);
QSortFilterProxyModel *proxyModel = new QSortFilterProxyModel(&fd);
fd.setProxyModel(proxyModel);
QCOMPARE(fd.proxyModel(), (QAbstractProxyModel *)proxyModel);
fd.setProxyModel(0);
- QCOMPARE(fd.proxyModel(), (QAbstractProxyModel*)0);
+ QCOMPARE(fd.proxyModel(), nullptr);
}
void tst_QFiledialog::setEmptyNameFilter()
diff --git a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp
index a16bd1a787..1ff7a0c97b 100644
--- a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp
+++ b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp
@@ -340,8 +340,7 @@ void tst_QFileDialog2::task143519_deleteAndRenameActionBehavior()
// test based on task233037_selectingDirectory
struct TestContext {
- TestContext()
- : current(QDir::current()) {}
+ explicit TestContext(const QString &path) : current(path) {}
~TestContext() {
file.remove();
current.rmdir(test.dirName());
@@ -349,7 +348,9 @@ void tst_QFileDialog2::task143519_deleteAndRenameActionBehavior()
QDir current;
QDir test;
QFile file;
- } ctx;
+ };
+
+ TestContext ctx(tempDir.path());
// setup testbed
QVERIFY(ctx.current.mkdir("task143519_deleteAndRenameActionBehavior_test")); // ensure at least one item
@@ -363,6 +364,7 @@ void tst_QFileDialog2::task143519_deleteAndRenameActionBehavior()
QFileDialog fd;
fd.setViewMode(QFileDialog::List);
fd.setDirectory(ctx.test.absolutePath());
+ fd.selectFile(ctx.file.fileName());
fd.show();
QTest::qWaitForWindowActive(&fd);
@@ -377,7 +379,7 @@ void tst_QFileDialog2::task143519_deleteAndRenameActionBehavior()
// defaults
QVERIFY(openContextMenu(fd));
- QCOMPARE(fd.selectedFiles().size(), 1);
+ QCOMPARE(fd.selectedFiles(), QStringList(ctx.file.fileName()));
QCOMPARE(rm->isEnabled(), !fd.isReadOnly());
QCOMPARE(mv->isEnabled(), !fd.isReadOnly());
diff --git a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp
index 0bb2c50b9d..31df66e312 100644
--- a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp
+++ b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp
@@ -135,7 +135,7 @@ tst_QFileSystemModel::tst_QFileSystemModel() : model(0)
void tst_QFileSystemModel::init()
{
cleanup();
- QCOMPARE(model, (QFileSystemModel*)0);
+ QCOMPARE(model, nullptr);
model = new QFileSystemModel;
}
diff --git a/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp b/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp
index 2a629c3ff0..db86fba59c 100644
--- a/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp
+++ b/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp
@@ -2400,7 +2400,7 @@ void tst_QWizard::removePage()
QCOMPARE(arguments.at(0).toInt(), 3);
QVERIFY(wizard.visitedPages().empty());
QVERIFY(wizard.pageIds().empty());
- QCOMPARE(wizard.currentPage(), static_cast<QWizardPage *>(0));
+ QCOMPARE(wizard.currentPage(), nullptr);
}
void tst_QWizard::sideWidget()