From ab42391cd0b4cb0be03d0083f4e0d2b039a85a19 Mon Sep 17 00:00:00 2001 From: John Layt Date: Mon, 20 Jan 2014 17:59:57 +0100 Subject: QPrintEngine - Switch Windows to QPlatformPrintDevice Change the Windows QPrintEngine implementation to use the QPlatformPrintDevice to obtain device information, and use QPageSize to obtain page size conversions. A following change will use QPageLayout to store that page size. Change-Id: I990943e2b62ab6dab2c4d4a292c7ed7261beadf2 Reviewed-by: Lars Knoll --- .../printsupport/kernel/qprinter/tst_qprinter.cpp | 47 ++++------------------ 1 file changed, 8 insertions(+), 39 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp index 64f74c1241..1a3edd1540 100644 --- a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp +++ b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp @@ -88,9 +88,6 @@ public slots: void cleanupTestCase(); #else private slots: -#ifdef Q_OS_WIN - void testNonExistentPrinter(); -#endif void testPageRectAndPaperRect(); void testPageRectAndPaperRect_data(); void testSetOptions(); @@ -356,40 +353,6 @@ void tst_QPrinter::testMargins() QFile::remove("silly"); } -#ifdef Q_OS_WIN -// QPrinter::testNonExistentPrinter() is not relevant for this platform -void tst_QPrinter::testNonExistentPrinter() -{ - QPrinter printer; - QPainter painter; - - // Make sure it doesn't crash on setting or getting properties - printer.printEngine()->setProperty(QPrintEngine::PPK_PrinterName, "some non existing printer"); - printer.setPageSize(QPrinter::A4); - printer.setOrientation(QPrinter::Portrait); - printer.setFullPage(true); - printer.pageSize(); - printer.orientation(); - printer.fullPage(); - printer.setCopyCount(1); - printer.printerName(); - - // nor metrics - QCOMPARE(printer.printEngine()->metric(QPaintDevice::PdmWidth), 0); - QCOMPARE(printer.printEngine()->metric(QPaintDevice::PdmHeight), 0); - QCOMPARE(printer.printEngine()->metric(QPaintDevice::PdmWidthMM), 0); - QCOMPARE(printer.printEngine()->metric(QPaintDevice::PdmHeightMM), 0); - QCOMPARE(printer.printEngine()->metric(QPaintDevice::PdmNumColors), 0); - QCOMPARE(printer.printEngine()->metric(QPaintDevice::PdmDepth), 0); - QCOMPARE(printer.printEngine()->metric(QPaintDevice::PdmDpiX), 0); - QCOMPARE(printer.printEngine()->metric(QPaintDevice::PdmDpiY), 0); - QCOMPARE(printer.printEngine()->metric(QPaintDevice::PdmPhysicalDpiX), 0); - QCOMPARE(printer.printEngine()->metric(QPaintDevice::PdmPhysicalDpiY), 0); - - QVERIFY(!painter.begin(&printer)); -} -#endif - void tst_QPrinter::testMulitpleSets_data() { QTest::addColumn("resolution"); @@ -779,7 +742,10 @@ void tst_QPrinter::customPaperNameSettingBySize() QSKIP("No printers installed on this machine"); for (int i=0; i