summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpagedpaintdevice.h
diff options
context:
space:
mode:
authorAlbert Astals Cid <albert.astals.cid@kdab.com>2018-02-07 14:41:53 +0100
committerAlbert Astals Cid <albert.astals.cid@kdab.com>2018-02-16 08:10:49 +0000
commit21e5da2fe0a3c9450de60b846d2f0836e4455976 (patch)
treeab99d3bbc09223dde9e5c9dd67bcb815eeb21625 /src/gui/painting/qpagedpaintdevice.h
parent048d8dee52545a9b0a548b4c56958a75a99d9aee (diff)
QPagedPainterDevicePrivate: Remove m_pageLayout
Having it there is awkward since all the subclasses of QPagedPaintDevice, that is QPdfWriter and QPrinter, have their own m_pageLayout via their private engine classes so we ended up with code like pd->engine->setPageMargins(margins, units); // Set QPagedPaintDevice layout to match the current paint engine layout m_pageLayout = pd->engine->pageLayout(); Now we just use the subclass for it's page layout and all is simpler since we don't need to make sure the two variables are updated to have the same contents. Unfortunately this means that we have to implement a dummy subclass for QPagedPaintDevice(). That constructor doesn't make any sense since QPagedPaintDevice is not really a leaf you want to instantiate, it's there to provide common api for the subclasses and the QPagedPaintDevice(QPagedPaintDevicePrivate *dd) constructor should be used. Since it's a public class we can't remove that constructor and that's why we have that QDummyPagedPaintDevicePrivate. QPageLayout &QPagedPaintDevice::devicePageLayout() is also deprecated now since there's no "device" page layout anymore. Those functions were marked internal and as far as I can see unused outside QPdfWriter/QPrinter so it should be fine. [ChangeLog][QtGui] QPagedPaintDevice constructor has been deprecated since that class is not meant to be used standalone, its two public but internal devicePageLayout() methods are now deprecated. Change-Id: I054601b66afcb7dd662db6247c5ed7820fbee212 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'src/gui/painting/qpagedpaintdevice.h')
-rw-r--r--src/gui/painting/qpagedpaintdevice.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/painting/qpagedpaintdevice.h b/src/gui/painting/qpagedpaintdevice.h
index 66dd6fa8cf..c8957edab8 100644
--- a/src/gui/painting/qpagedpaintdevice.h
+++ b/src/gui/painting/qpagedpaintdevice.h
@@ -55,7 +55,7 @@ class QPagedPaintDevicePrivate;
class Q_GUI_EXPORT QPagedPaintDevice : public QPaintDevice
{
public:
- QPagedPaintDevice();
+ QT_DEPRECATED QPagedPaintDevice();
~QPagedPaintDevice();
virtual bool newPage() = 0;
@@ -243,8 +243,8 @@ public:
protected:
QPagedPaintDevice(QPagedPaintDevicePrivate *dd);
QPagedPaintDevicePrivate *dd();
- QPageLayout devicePageLayout() const;
- QPageLayout &devicePageLayout();
+ QT_DEPRECATED QPageLayout devicePageLayout() const;
+ QT_DEPRECATED QPageLayout &devicePageLayout();
friend class QPagedPaintDevicePrivate;
QPagedPaintDevicePrivate *d;
};