diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2015-12-09 23:16:22 +0100 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2015-12-10 22:26:01 +0000 |
commit | 824af4aac959d95402d70fb235433aafb20d5c43 (patch) | |
tree | 05dfc8ff66f9b9536508c79b50bcb827c4c1e71a | |
parent | 56f6252e7285c9c61a99416fa2a8571fd67c597f (diff) |
QFileDialog test: make the right subwidget visible
It makes little sense to give focus to a hidden widget; in order
to make the treeview visible, we need to set the view mode to Detail.
Change-Id: I453111e83593a790a656651b603a9c9b1a78dd9d
Task-number: QTBUG-7690
Reviewed-by: Jan Blumschein <jan@jan-blumschein.de>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
-rw-r--r-- | tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp index b04711b282..b457558879 100644 --- a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp +++ b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp @@ -774,14 +774,16 @@ void tst_QFileDialog2::task233037_selectingDirectory() void tst_QFileDialog2::task235069_hideOnEscape_data() { QTest::addColumn<QString>("childName"); - QTest::newRow("listView") << QStringLiteral("listView"); - QTest::newRow("fileNameEdit") << QStringLiteral("fileNameEdit"); - QTest::newRow("treeView") << QStringLiteral("treeView"); + QTest::addColumn<QFileDialog::ViewMode>("viewMode"); + QTest::newRow("listView") << QStringLiteral("listView") << QFileDialog::List; + QTest::newRow("fileNameEdit") << QStringLiteral("fileNameEdit") << QFileDialog::List; + QTest::newRow("treeView") << QStringLiteral("treeView") << QFileDialog::Detail; } void tst_QFileDialog2::task235069_hideOnEscape() { QFETCH(QString, childName); + QFETCH(QFileDialog::ViewMode, viewMode); QDir current = QDir::currentPath(); QNonNativeFileDialog fd; @@ -789,7 +791,7 @@ void tst_QFileDialog2::task235069_hideOnEscape() QVERIFY(spyFinished.isValid()); QSignalSpy spyRejected(&fd, &QDialog::rejected); QVERIFY(spyRejected.isValid()); - fd.setViewMode(QFileDialog::List); + fd.setViewMode(viewMode); fd.setDirectory(current.absolutePath()); fd.setAcceptMode(QFileDialog::AcceptSave); fd.show(); |