From 6bbf3f0257603eb39d5511910e8bee1ed862b6cf Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Wed, 2 Sep 2020 16:23:06 +0200 Subject: Mark obsolete QPrinter functions as deprecated from 5.15 on MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some of the methods are overrides of virtuals in QPagedPaintDevice, so document and mark those as obsolete as well. Adjust code that calls those APIs to use the recommended replacement. Change-Id: I3cd1980609ea20808d17379a5f97ca595e869875 Pick-to: 5.15 Reviewed-by: Tor Arne Vestbø --- src/gui/painting/qpagedpaintdevice.cpp | 8 +++++++- src/gui/painting/qpagedpaintdevice.h | 10 ++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'src/gui/painting') diff --git a/src/gui/painting/qpagedpaintdevice.cpp b/src/gui/painting/qpagedpaintdevice.cpp index ecb952a8bd..2149bd8cff 100644 --- a/src/gui/painting/qpagedpaintdevice.cpp +++ b/src/gui/painting/qpagedpaintdevice.cpp @@ -136,7 +136,8 @@ QPagedPaintDevicePrivate *QPagedPaintDevice::dd() \enum QPagedPaintDevice::PageSize This enum type lists the available page sizes as defined in the Postscript - PPD standard. These values are duplicated in QPageSize and QPrinter. + PPD standard. These values are duplicated in QPageSize and QPrinter and + those types and enum will be merged in Qt 6. The defined sizes are: @@ -315,6 +316,7 @@ QPagedPaintDevice::PageSize QPagedPaintDevice::pageSize() const } /*! + \obsolete Use setPageSize(QPageSize) instead. Sets the page size to \a size. \a size is specified in millimeters. If the size matches a standard QPagedPaintDevice::PageSize then that page @@ -326,6 +328,8 @@ void QPagedPaintDevice::setPageSizeMM(const QSizeF &size) } /*! + \obsolete Use pageLayout().pageSize() instead. + Returns the page size in millimeters. */ QSizeF QPagedPaintDevice::pageSizeMM() const @@ -334,6 +338,7 @@ QSizeF QPagedPaintDevice::pageSizeMM() const } /*! + \obsolete Use setPageMargins(QMarginsF, QPageLayout::Unit) instead. Sets the margins to be used to \a margins. Margins are specified in millimeters. @@ -349,6 +354,7 @@ void QPagedPaintDevice::setMargins(const QMarginsF &margins) } /*! + \obsolete Use pageLayout().margins() instead. Returns the current margins of the paint device. The default is 0. Margins are specified in millimeters. diff --git a/src/gui/painting/qpagedpaintdevice.h b/src/gui/painting/qpagedpaintdevice.h index 914a72b7be..f4e671f2d2 100644 --- a/src/gui/painting/qpagedpaintdevice.h +++ b/src/gui/painting/qpagedpaintdevice.h @@ -224,14 +224,24 @@ public: bool setPageMargins(const QMarginsF &margins, QPageLayout::Unit units); QPageLayout pageLayout() const; +#if QT_DEPRECATED_SINCE(5,15) + QT_DEPRECATED_VERSION_X_5_15("Use setPageSize(QPageSize) instead.") virtual void setPageSize(PageSize size); + QT_DEPRECATED_VERSION_X_5_15("Use pageLayout().pageSize().id() instead.") PageSize pageSize() const; + QT_DEPRECATED_VERSION_X_5_15("Use setPageSize(QPageSize) instead.") virtual void setPageSizeMM(const QSizeF &size); + QT_DEPRECATED_VERSION_X_5_15("Use pageLayout().pageSize() instead.") QSizeF pageSizeMM() const; +#endif +#if QT_DEPRECATED_SINCE(5,15) + QT_DEPRECATED_VERSION_X_5_15("Use setPageMargins(QMarginsF, QPageLayout::Unit) instead.") virtual void setMargins(const QMarginsF &margins); + QT_DEPRECATED_VERSION_X_5_15("Use pageLayout().margins() instead.") QMarginsF margins() const; +#endif protected: QPagedPaintDevice(QPagedPaintDevicePrivate *dd); -- cgit v1.2.3