summaryrefslogtreecommitdiffstats
path: root/src/printsupport/kernel/qprintengine_win_p.h
diff options
context:
space:
mode:
authorJohn Layt <jlayt@kde.org>2014-01-27 13:31:38 -0500
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-17 13:46:07 +0100
commit70081096a152d6973d85a1c1466bbc058fe0b24b (patch)
tree4d5ebd9171fe4f0184f3a4c080a2ca57eb3cffd0 /src/printsupport/kernel/qprintengine_win_p.h
parentab42391cd0b4cb0be03d0083f4e0d2b039a85a19 (diff)
QPrintEngine - Switch Windows to QPageLayout
Switch the Windows QPrintEngine to use QPageLayout. Change-Id: I2b617fe103980c4efbb0ed367547e436f2d8a5e2 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/printsupport/kernel/qprintengine_win_p.h')
-rw-r--r--src/printsupport/kernel/qprintengine_win_p.h39
1 files changed, 12 insertions, 27 deletions
diff --git a/src/printsupport/kernel/qprintengine_win_p.h b/src/printsupport/kernel/qprintengine_win_p.h
index 61bf63346b..9b944d5921 100644
--- a/src/printsupport/kernel/qprintengine_win_p.h
+++ b/src/printsupport/kernel/qprintengine_win_p.h
@@ -129,12 +129,10 @@ public:
mode(QPrinter::ScreenResolution),
state(QPrinter::Idle),
resolution(0),
- pageMarginsSet(false),
+ m_pageLayout(QPageLayout(QPageSize(QPageSize::A4), QPageLayout::Portrait, QMarginsF(0, 0, 0, 0))),
num_copies(1),
printToFile(false),
- fullPage(false),
- reinit(false),
- has_custom_paper_size(false)
+ reinit(false)
{
}
@@ -173,13 +171,9 @@ public:
void strokePath_dev(const QPainterPath &path, const QColor &color, qreal width);
void setPageSize(const QPageSize &pageSize);
- void updatePageSize();
-
- void updateOrigin();
-
- void initDevRects();
- void setPageMargins(int margin_left, int margin_top, int margin_right, int margin_bottom);
- QRect getPageMargins() const;
+ void updatePageLayout();
+ void updateMetrics();
+ void debugMetrics() const;
// Windows GDI printer references.
HANDLE hPrinter;
@@ -205,21 +199,13 @@ public:
int resolution;
// Page Layout
- QPageSize m_pageSize;
-
- // This QRect is used to store the exact values
- // entered into the PageSetup Dialog because those are
- // entered in mm but are since converted to device coordinates.
- // If they were to be converted back when displaying the dialog
- // again, there would be inaccuracies so when the user entered 10
- // it may show up as 9.99 the next time the dialog is opened.
- // We don't want that confusion.
- QRect previousDialogMargins;
-
- bool pageMarginsSet;
- QRect devPageRect;
- QRect devPhysicalPageRect;
- QRect devPaperRect;
+ QPageLayout m_pageLayout;
+
+ // Page metrics cache
+ QRect m_paintRectPixels;
+ QSize m_paintSizeMM;
+
+ // Windows painting
qreal stretch_x;
qreal stretch_y;
int origin_x;
@@ -231,7 +217,6 @@ public:
int num_copies;
uint printToFile : 1;
- uint fullPage : 1;
uint reinit : 1;
uint complex_xform : 1;