summaryrefslogtreecommitdiffstats
path: root/tests/auto/qprinter/tst_qprinter.cpp
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2010-03-05 03:56:47 (GMT)
committerBea Lam <bea.lam@nokia.com>2010-03-05 03:56:47 (GMT)
commit0c558e05f880cb51078b2d5e5281227352c1de3f (patch)
tree809e95ab06fc5d757c1d66493de5c9376866aee1 /tests/auto/qprinter/tst_qprinter.cpp
parentaf81ea8a5abbd9a94eb6ab5c3fe0425779905d5a (diff)
parent48fd47f64f3f73e82016161d82cdf67908a9c653 (diff)
downloadQt-0c558e05f880cb51078b2d5e5281227352c1de3f.zip
Qt-0c558e05f880cb51078b2d5e5281227352c1de3f.tar.gz
Qt-0c558e05f880cb51078b2d5e5281227352c1de3f.tar.bz2
Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'tests/auto/qprinter/tst_qprinter.cpp')
-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"