diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-09-03 18:42:30 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-09-04 08:37:59 +0200 |
commit | 00a5629d8de18bc1a5dfb6e2526c03b4b021c903 (patch) | |
tree | d444ede3eb66e5455e09c4de3fda32bcd7437a4a /src/gui/painting/qpagedpaintdevice.cpp | |
parent | 6b171dc6c0c0f0a822b212df77b58b28bd92716c (diff) |
Remove deprecated QPrinter and QPagedPaintDevice APIs
Adjusting the QPrinter test case - some use cases no longer exist, or are
already tested in QPageSize and QPageLayout tests.
Adjust examples and manual tests.
Change-Id: I01cbc65f3d8031aea2dac86dd942126ba708b111
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/gui/painting/qpagedpaintdevice.cpp')
-rw-r--r-- | src/gui/painting/qpagedpaintdevice.cpp | 165 |
1 files changed, 0 insertions, 165 deletions
diff --git a/src/gui/painting/qpagedpaintdevice.cpp b/src/gui/painting/qpagedpaintdevice.cpp index 2149bd8cff..dba143b7e3 100644 --- a/src/gui/painting/qpagedpaintdevice.cpp +++ b/src/gui/painting/qpagedpaintdevice.cpp @@ -42,42 +42,6 @@ QT_BEGIN_NAMESPACE -// ### Qt 6: remove when the deprecated constructor is removed -class QDummyPagedPaintDevicePrivate : public QPagedPaintDevicePrivate -{ - bool setPageLayout(const QPageLayout &newPageLayout) override - { - m_pageLayout = newPageLayout; - return m_pageLayout.isEquivalentTo(newPageLayout); - } - - bool setPageSize(const QPageSize &pageSize) override - { - m_pageLayout.setPageSize(pageSize); - return m_pageLayout.pageSize().isEquivalentTo(pageSize); - } - - bool setPageOrientation(QPageLayout::Orientation orientation) override - { - m_pageLayout.setOrientation(orientation); - return m_pageLayout.orientation() == orientation; - } - - bool setPageMargins(const QMarginsF &margins, QPageLayout::Unit units) override - { - m_pageLayout.setUnits(units); - m_pageLayout.setMargins(margins); - return m_pageLayout.margins() == margins && m_pageLayout.units() == units; - } - - QPageLayout pageLayout() const override - { - return m_pageLayout; - } - - QPageLayout m_pageLayout; -}; - QPagedPaintDevicePrivate::~QPagedPaintDevicePrivate() { delete rangeCollection; @@ -96,15 +60,6 @@ QPagedPaintDevicePrivate::~QPagedPaintDevicePrivate() QPdfWriter and QPrinter inherit from it. */ -/*! - Constructs a new paged paint device. - - \deprecated - */ -QPagedPaintDevice::QPagedPaintDevice() - : d(new QDummyPagedPaintDevicePrivate) -{ -} /*! \internal @@ -298,75 +253,6 @@ QPagedPaintDevicePrivate *QPagedPaintDevice::dd() */ /*! - Sets the size of the a page to \a size. - - \sa setPageSizeMM() - */ -void QPagedPaintDevice::setPageSize(PageSize size) -{ - d->setPageSize(QPageSize(QPageSize::PageSizeId(size))); -} - -/*! - Returns the currently used page size. - */ -QPagedPaintDevice::PageSize QPagedPaintDevice::pageSize() const -{ - return PageSize(d->pageLayout().pageSize().id()); -} - -/*! - \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 - size will be used, otherwise QPagedPaintDevice::Custom will be set. -*/ -void QPagedPaintDevice::setPageSizeMM(const QSizeF &size) -{ - d->setPageSize(QPageSize(size, QPageSize::Millimeter)); -} - -/*! - \obsolete Use pageLayout().pageSize() instead. - - Returns the page size in millimeters. - */ -QSizeF QPagedPaintDevice::pageSizeMM() const -{ - return d->pageLayout().pageSize().size(QPageSize::Millimeter); -} - -/*! - \obsolete Use setPageMargins(QMarginsF, QPageLayout::Unit) instead. - Sets the margins to be used to \a margins. - - Margins are specified in millimeters. - - The margins are purely a hint to the drawing method. They don't affect the - coordinate system or clipping. - - \sa margins() - */ -void QPagedPaintDevice::setMargins(const QMarginsF &margins) -{ - d->setPageMargins(margins, QPageLayout::Millimeter); -} - -/*! - \obsolete Use pageLayout().margins() instead. - Returns the current margins of the paint device. The default is 0. - - Margins are specified in millimeters. - - \sa setMargins() - */ -QMarginsF QPagedPaintDevice::margins() const -{ - return d->pageLayout().margins(QPageLayout::Millimeter); -} - -/*! \since 5.3 Sets the page layout to \a newPageLayout. @@ -436,28 +322,6 @@ bool QPagedPaintDevice::setPageOrientation(QPageLayout::Orientation orientation) /*! \since 5.3 - Set the page \a margins in the current page layout units. - - You should call this before calling QPainter::begin(), or immediately - before calling newPage() to apply the new margins to a new page. - You should not call any painting methods between a call to setPageMargins() - and newPage() as the wrong paint metrics may be used. - - To get the current page margins use pageLayout().pageMargins(). - - Returns true if the page margins were successfully set to \a margins. - - \sa pageLayout() -*/ - -bool QPagedPaintDevice::setPageMargins(const QMarginsF &margins) -{ - return setPageMargins(margins, pageLayout().units()); -} - -/*! - \since 5.3 - Set the page \a margins defined in the given \a units. You should call this before calling QPainter::begin(), or immediately @@ -494,33 +358,4 @@ QPageLayout QPagedPaintDevice::pageLayout() const return d->pageLayout(); } -/*! - \internal - - \deprecated - - Returns the internal device page layout. -*/ - -QPageLayout QPagedPaintDevice::devicePageLayout() const -{ - qWarning("QPagedPaintDevice::devicePageLayout() is deprecated, just use QPagedPaintDevice::pageLayout()"); - return d->pageLayout(); -} - -/*! - \internal - - \deprecated - - Returns the internal device page layout. -*/ - -QPageLayout &QPagedPaintDevice::devicePageLayout() -{ - qWarning("QPagedPaintDevice::devicePageLayout() is deprecated, you shouldn't be using this at all."); - static QPageLayout dummy; - return dummy; -} - QT_END_NAMESPACE |