diff options
author | Alexis Menard <alexis.menard@nokia.com> | 2010-07-15 09:08:17 (GMT) |
---|---|---|
committer | Alexis Menard <alexis.menard@nokia.com> | 2010-07-15 09:10:22 (GMT) |
commit | 910b8fe6222011b8f94259f165bcf4d4002172c0 (patch) | |
tree | 26b20e1a3464499876af0c4d1cac7fe84200a375 /tests | |
parent | 633349982422fec92df4ed06da5d2becf788c494 (diff) | |
download | Qt-910b8fe6222011b8f94259f165bcf4d4002172c0.zip Qt-910b8fe6222011b8f94259f165bcf4d4002172c0.tar.gz Qt-910b8fe6222011b8f94259f165bcf4d4002172c0.tar.bz2 |
QFileDialog : Fix completer showing up on the MyComputer view.
Only complete if there is a text to complete
Reviewed-by:janarve
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qfiledialog2/tst_qfiledialog2.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/qfiledialog2/tst_qfiledialog2.cpp b/tests/auto/qfiledialog2/tst_qfiledialog2.cpp index eee495f..6299c24 100644 --- a/tests/auto/qfiledialog2/tst_qfiledialog2.cpp +++ b/tests/auto/qfiledialog2/tst_qfiledialog2.cpp @@ -140,6 +140,7 @@ private slots: void QTBUG4419_lineEditSelectAll(); void QTBUG6558_showDirsOnly(); void QTBUG4842_selectFilterWithHideNameFilterDetails(); + void dontShowCompleterOnRoot(); private: QByteArray userSettings; @@ -1194,5 +1195,26 @@ void tst_QFileDialog2::QTBUG4842_selectFilterWithHideNameFilterDetails() } +void tst_QFileDialog2::dontShowCompleterOnRoot() +{ + QNonNativeFileDialog fd(0, "TestFileDialog"); + fd.setAcceptMode(QFileDialog::AcceptSave); + fd.show(); + + QApplication::setActiveWindow(&fd); + QTest::qWaitForWindowShown(&fd); + QTRY_COMPARE(fd.isVisible(), true); + QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget*>(&fd)); + + fd.setDirectory(""); + QLineEdit *lineEdit = qFindChild<QLineEdit*>(&fd, "fileNameEdit"); + QTRY_VERIFY(lineEdit->text().isEmpty()); + + //The gatherer thread will then return the result + QApplication::processEvents(); + + QTRY_VERIFY(lineEdit->completer()->popup()->isHidden()); +} + QTEST_MAIN(tst_QFileDialog2) #include "tst_qfiledialog2.moc" |