diff options
Diffstat (limited to 'tests/auto/printsupport/kernel')
-rw-r--r-- | tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp | 62 |
1 files changed, 29 insertions, 33 deletions
diff --git a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp index 7529bad833..f3a6c4c695 100644 --- a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp +++ b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp @@ -1816,16 +1816,12 @@ void tst_QPrinter::testPageMetrics() if (setMargins) { // Setup the given margins - QPrinter::Margins margins; - margins.left = leftMMf; - margins.right = rightMMf; - margins.top = topMMf; - margins.bottom = bottomMMf; + QMarginsF margins(leftMMf, topMMf, rightMMf, bottomMMf); printer.setMargins(margins); - QCOMPARE(printer.margins().left, leftMMf); - QCOMPARE(printer.margins().right, rightMMf); - QCOMPARE(printer.margins().top, topMMf); - QCOMPARE(printer.margins().bottom, bottomMMf); + QCOMPARE(printer.margins().left(), leftMMf); + QCOMPARE(printer.margins().right(), rightMMf); + QCOMPARE(printer.margins().top(), topMMf); + QCOMPARE(printer.margins().bottom(), bottomMMf); } @@ -1840,17 +1836,17 @@ void tst_QPrinter::testPageMetrics() QCOMPARE(printer.orientation(), QPrinter::Portrait); if (setMargins) { // Check margins unchanged from page size change - QCOMPARE(printer.margins().left, leftMMf); - QCOMPARE(printer.margins().right, rightMMf); - QCOMPARE(printer.margins().top, topMMf); - QCOMPARE(printer.margins().bottom, bottomMMf); + QCOMPARE(printer.margins().left(), leftMMf); + QCOMPARE(printer.margins().right(), rightMMf); + QCOMPARE(printer.margins().top(), topMMf); + QCOMPARE(printer.margins().bottom(), bottomMMf); } else { // Fetch the default margins for the printer and page size // TODO Check against margins from print device when api added - leftMMf = printer.margins().left; - rightMMf = printer.margins().right; - topMMf = printer.margins().top; - bottomMMf = printer.margins().bottom; + leftMMf = printer.margins().left(); + rightMMf = printer.margins().right(); + topMMf = printer.margins().top(); + bottomMMf = printer.margins().bottom(); } // QPagedPaintDevice::pageSizeMM() always returns Portrait @@ -1880,17 +1876,17 @@ void tst_QPrinter::testPageMetrics() QCOMPARE(printer.orientation(), QPrinter::Landscape); if (setMargins) { // Check margins unchanged from page size change - QCOMPARE(printer.margins().left, leftMMf); - QCOMPARE(printer.margins().right, rightMMf); - QCOMPARE(printer.margins().top, topMMf); - QCOMPARE(printer.margins().bottom, bottomMMf); + QCOMPARE(printer.margins().left(), leftMMf); + QCOMPARE(printer.margins().right(), rightMMf); + QCOMPARE(printer.margins().top(), topMMf); + QCOMPARE(printer.margins().bottom(), bottomMMf); } else { // Fetch the default margins for the printer and page size // TODO Check against margins from print device when api added - leftMMf = printer.margins().left; - rightMMf = printer.margins().right; - topMMf = printer.margins().top; - bottomMMf = printer.margins().bottom; + leftMMf = printer.margins().left(); + rightMMf = printer.margins().right(); + topMMf = printer.margins().top(); + bottomMMf = printer.margins().bottom(); } // QPagedPaintDevice::pageSizeMM() always returns Portrait @@ -1921,17 +1917,17 @@ void tst_QPrinter::testPageMetrics() QCOMPARE(printer.orientation(), QPrinter::Landscape); if (setMargins) { // Check margins unchanged from page size change - QCOMPARE(printer.margins().left, leftMMf); - QCOMPARE(printer.margins().right, rightMMf); - QCOMPARE(printer.margins().top, topMMf); - QCOMPARE(printer.margins().bottom, bottomMMf); + QCOMPARE(printer.margins().left(), leftMMf); + QCOMPARE(printer.margins().right(), rightMMf); + QCOMPARE(printer.margins().top(), topMMf); + QCOMPARE(printer.margins().bottom(), bottomMMf); } else { // Fetch the default margins for the printer and page size // TODO Check against margins from print device when api added - leftMMf = printer.margins().left; - rightMMf = printer.margins().right; - topMMf = printer.margins().top; - bottomMMf = printer.margins().bottom; + leftMMf = printer.margins().left(); + rightMMf = printer.margins().right(); + topMMf = printer.margins().top(); + bottomMMf = printer.margins().bottom(); } // QPagedPaintDevice::pageSizeMM() always returns Portrait |