summaryrefslogtreecommitdiffstats
path: root/tests/auto/qprinter
diff options
context:
space:
mode:
authorJoão Abecasis <joao@abecasis.name>2009-05-07 20:53:22 +0200
committerJoão Abecasis <joao@abecasis.name>2009-05-08 13:28:35 +0200
commit42b5bc2e21cbed70b64fcd1f1bcf9282444206dd (patch)
treebe684bf472b4567ad02a1f1f583e70be061b5512 /tests/auto/qprinter
parent813835f67a1053561eba67bf958eb39c0f4eedfe (diff)
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/auto/qprinter')
-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 a598bfc2b1..cde4ae5ead 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"