summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJoão Abecasis <joao@abecasis.name>2009-05-07 18:53:22 (GMT)
committerJoão Abecasis <joao@abecasis.name>2009-05-08 11:28:35 (GMT)
commit42b5bc2e21cbed70b64fcd1f1bcf9282444206dd (patch)
treebe684bf472b4567ad02a1f1f583e70be061b5512 /tests
parent813835f67a1053561eba67bf958eb39c0f4eedfe (diff)
downloadQt-42b5bc2e21cbed70b64fcd1f1bcf9282444206dd.zip
Qt-42b5bc2e21cbed70b64fcd1f1bcf9282444206dd.tar.gz
Qt-42b5bc2e21cbed70b64fcd1f1bcf9282444206dd.tar.bz2
Fixes a crash in QPrinterDialog with relative filenames
It's better to set the sourceModel in the constructor for QFSCompletor, as requiring that it be set separately is error prone. Surprisingly, the printer dialog crash only appears to happen when using relative filenames. Task-number: 253135 Reviewed-by: alexis
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qprinter/tst_qprinter.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/qprinter/tst_qprinter.cpp b/tests/auto/qprinter/tst_qprinter.cpp
index a598bfc..cde4ae5 100644
--- a/tests/auto/qprinter/tst_qprinter.cpp
+++ b/tests/auto/qprinter/tst_qprinter.cpp
@@ -103,6 +103,7 @@ private slots:
void valuePreservation();
void errorReporting();
void testCustomPageSizes();
+ void printDialogCompleter();
private:
};
@@ -940,5 +941,22 @@ void tst_QPrinter::testCustomPageSizes()
QCOMPARE(paperSize, customSize);
}
+void tst_QPrinter::printDialogCompleter()
+{
+#if defined(QT_NO_COMPLETER) || defined(QT_NO_FILEDIALOG)
+ QSKIP("QT_NO_COMPLETER || QT_NO_FILEDIALOG: Auto-complete turned off in QPrinterDialog.", QTest::SkipAll);
+#else
+ QPrintDialog dialog;
+ dialog.printer()->setOutputFileName("file.pdf");
+ dialog.setEnabledOptions(QAbstractPrintDialog::PrintToFile);
+ dialog.show();
+
+ QTest::qWait(100);
+
+ QTest::keyClick(0, Qt::Key_Tab);
+ QTest::keyClick(0, 'P');
+#endif
+}
+
QTEST_MAIN(tst_QPrinter)
#include "tst_qprinter.moc"