summaryrefslogtreecommitdiffstats
path: root/tests/auto/qprinter
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qprinter')
-rw-r--r--tests/auto/qprinter/tst_qprinter.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/auto/qprinter/tst_qprinter.cpp b/tests/auto/qprinter/tst_qprinter.cpp
index 7e8ce84..49bddb2 100644
--- a/tests/auto/qprinter/tst_qprinter.cpp
+++ b/tests/auto/qprinter/tst_qprinter.cpp
@@ -107,6 +107,7 @@ private slots:
void printDialogCompleter();
void testCopyCount();
+ void testCurrentPage();
void taskQTBUG4497_reusePrinterOnDifferentFiles();
@@ -1005,5 +1006,27 @@ void tst_QPrinter::taskQTBUG4497_reusePrinterOnDifferentFiles()
QCOMPARE(file1.readAll(), file2.readAll());
}
+void tst_QPrinter::testCurrentPage()
+{
+ QPrinter printer;
+ printer.setFromTo(1, 10);
+
+ // Test set print range
+ printer.setPrintRange(QPrinter::CurrentPage);
+ QCOMPARE(printer.printRange(), QPrinter::CurrentPage);
+ QCOMPARE(printer.fromPage(), 1);
+ QCOMPARE(printer.toPage(), 10);
+
+ QPrintDialog dialog(&printer);
+
+ // Test default Current Page option to off
+ QCOMPARE(dialog.isOptionEnabled(QPrintDialog::PrintCurrentPage), false);
+
+ // Test enable Current Page option
+ dialog.setOption(QPrintDialog::PrintCurrentPage);
+ QCOMPARE(dialog.isOptionEnabled(QPrintDialog::PrintCurrentPage), true);
+
+}
+
QTEST_MAIN(tst_QPrinter)
#include "tst_qprinter.moc"