summaryrefslogtreecommitdiffstats
path: root/tests/auto/qprinter/tst_qprinter.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-10-06 08:52:17 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-10-06 08:52:17 (GMT)
commit58563dcb2cab0949d21337b7b7cd34e3bdd29bbc (patch)
tree2715d69c247748ba1501e50ec432415d3ffebcae /tests/auto/qprinter/tst_qprinter.cpp
parent564f65bdcf42bcdaceea902b99bcbfafef5b97f3 (diff)
parent2dc7fae7ea38a0169c4c5c78d0534d688347aacb (diff)
downloadQt-58563dcb2cab0949d21337b7b7cd34e3bdd29bbc.zip
Qt-58563dcb2cab0949d21337b7b7cd34e3bdd29bbc.tar.gz
Qt-58563dcb2cab0949d21337b7b7cd34e3bdd29bbc.tar.bz2
Merge branch '4.6'
Conflicts: src/corelib/io/qdatastream.h
Diffstat (limited to 'tests/auto/qprinter/tst_qprinter.cpp')
-rw-r--r--tests/auto/qprinter/tst_qprinter.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/auto/qprinter/tst_qprinter.cpp b/tests/auto/qprinter/tst_qprinter.cpp
index d6df94b..3c05d90 100644
--- a/tests/auto/qprinter/tst_qprinter.cpp
+++ b/tests/auto/qprinter/tst_qprinter.cpp
@@ -108,6 +108,8 @@ private slots:
void testActualNumCopies();
+ void taskQTBUG4497_reusePrinterOnDifferentFiles();
+
private:
};
@@ -971,5 +973,37 @@ void tst_QPrinter::testActualNumCopies()
QCOMPARE(p.actualNumCopies(), 15);
}
+static void printPage(QPainter *painter)
+{
+ painter->setPen(QPen(Qt::black, 4));
+ painter->drawRect(50, 60, 70, 80);
+}
+
+void tst_QPrinter::taskQTBUG4497_reusePrinterOnDifferentFiles()
+{
+ QPrinter printer;
+ {
+
+ printer.setOutputFileName("out1.ps");
+ QPainter painter(&printer);
+ printPage(&painter);
+
+ }
+ {
+
+ printer.setOutputFileName("out2.ps");
+ QPainter painter(&printer);
+ printPage(&painter);
+
+ }
+ QFile file1("out1.ps");
+ QVERIFY(file1.open(QIODevice::ReadOnly));
+
+ QFile file2("out2.ps");
+ QVERIFY(file2.open(QIODevice::ReadOnly));
+
+ QCOMPARE(file1.readAll(), file2.readAll());
+}
+
QTEST_MAIN(tst_QPrinter)
#include "tst_qprinter.moc"