From bc46b591b2cb81a5cb0c513aa4139b7e88fa8b06 Mon Sep 17 00:00:00 2001 From: John Layt Date: Fri, 28 Mar 2014 10:58:25 +0100 Subject: QPagedPaintDevice - Move QPageLayout methods The new QPageLayout methods weren't originally added to QPagePaintDevice as no new virtuals can be added, instead static polymorphism was used to add the methods directly in the derived classes QPdfWriter and QPrinter. This however means that classes like QTextDocument with print() methods that take a QPagedPaintDevice are unable to access the QPageLayout methods. To fix this, instead make the QPagedPaintDevicePrivate a virtual class and have QPdfWriter and QPrinter implement derived private classes that are called by the non-virtual QPagedPaintDevice base methods. Change-Id: Ieb6e513b1fa05f5ae76ea1f9156b0b1a053089eb Reviewed-by: Lars Knoll --- src/printsupport/kernel/qprinter.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/printsupport/kernel/qprinter.h') diff --git a/src/printsupport/kernel/qprinter.h b/src/printsupport/kernel/qprinter.h index 1f0639d81f..fa102d0fe3 100644 --- a/src/printsupport/kernel/qprinter.h +++ b/src/printsupport/kernel/qprinter.h @@ -307,11 +307,17 @@ public: void setCreator(const QString &); QString creator() const; +#ifdef Q_QDOC bool setPageLayout(const QPageLayout &pageLayout); bool setPageSize(const QPageSize &pageSize); bool setPageOrientation(QPageLayout::Orientation orientation); + bool setPageMargins(const QMarginsF &margins); bool setPageMargins(const QMarginsF &margins, QPageLayout::Unit units); QPageLayout pageLayout() const; +#else + using QPagedPaintDevice::setPageSize; + using QPagedPaintDevice::setPageMargins; +#endif void setOrientation(Orientation); Orientation orientation() const; -- cgit v1.2.3