summaryrefslogtreecommitdiffstats
path: root/src/printsupport/kernel
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2020-09-02 16:23:06 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2020-09-03 07:00:36 +0200
commit6bbf3f0257603eb39d5511910e8bee1ed862b6cf (patch)
tree6428d85d68637df32d7b94d6e55770164396f825 /src/printsupport/kernel
parent25351dcc549f1daddf5e2ae8a242191174342a3e (diff)
Mark obsolete QPrinter functions as deprecated from 5.15 on
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ø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/printsupport/kernel')
-rw-r--r--src/printsupport/kernel/qprinter.h34
1 files changed, 33 insertions, 1 deletions
diff --git a/src/printsupport/kernel/qprinter.h b/src/printsupport/kernel/qprinter.h
index 50b84e72d7..b912ed8f54 100644
--- a/src/printsupport/kernel/qprinter.h
+++ b/src/printsupport/kernel/qprinter.h
@@ -168,22 +168,35 @@ public:
using QPagedPaintDevice::setPageMargins;
#endif
+#if QT_DEPRECATED_SINCE(5,15)
+ QT_DEPRECATED_VERSION_X_5_15("Use setPageOrientation() instead.")
void setOrientation(Orientation);
+ QT_DEPRECATED_VERSION_X_5_15("Use pageLayout().pageOrientation() instead.")
Orientation orientation() const;
+ QT_DEPRECATED_VERSION_X_5_15("Use setPageSize(QPageSize) instead.")
void setPageSize(PageSize) override;
+ QT_DEPRECATED_VERSION_X_5_15("Use pageLayout().pageSize().id() instead.")
PageSize pageSize() const;
+ QT_DEPRECATED_VERSION_X_5_15("Use setPageSize(QPageSize) instead.")
void setPageSizeMM(const QSizeF &size) override;
+ QT_DEPRECATED_VERSION_X_5_15("Use setPageSize(QPageSize) instead.")
void setPaperSize(PaperSize);
+ QT_DEPRECATED_VERSION_X_5_15("pageLayout().pageSize().id()")
PaperSize paperSize() const;
+ QT_DEPRECATED_VERSION_X_5_15("Use setPageSize(QPageSize) instead.")
void setPaperSize(const QSizeF &paperSize, Unit unit);
+ QT_DEPRECATED_VERSION_X_5_15("Use pageLayout().pageSize().size() or pageLayout().fullPageSize() instead.")
QSizeF paperSize(Unit unit) const;
+ QT_DEPRECATED_VERSION_X_5_15("Use setPageSize(QPageSize) instead.")
void setPaperName(const QString &paperName);
+ QT_DEPRECATED_VERSION_X_5_15("Use pageLayout().pageSize().name() instead.")
QString paperName() const;
+#endif
void setPageOrder(PageOrder);
PageOrder pageOrder() const;
@@ -200,10 +213,14 @@ public:
void setFullPage(bool);
bool fullPage() const;
+#if QT_DEPRECATED_SINCE(5,15)
+ QT_DEPRECATED_VERSION_X_5_15("Use setCopyCount() instead.")
void setNumCopies(int);
+ QT_DEPRECATED_VERSION_X_5_15("Use copyCount() instead.")
int numCopies() const;
-
+ QT_DEPRECATED_VERSION_X_5_15("Use copyCount() instead.")
int actualNumCopies() const;
+#endif
void setCopyCount(int);
int copyCount() const;
@@ -224,14 +241,24 @@ public:
void setFontEmbeddingEnabled(bool enable);
bool fontEmbeddingEnabled() const;
+#if QT_DEPRECATED_SINCE(5,15)
+ QT_DEPRECATED_VERSION_X_5_15("Use setDuplex() instead.")
void setDoubleSidedPrinting(bool enable);
+ QT_DEPRECATED_VERSION_X_5_15("Use duplex() instead.")
bool doubleSidedPrinting() const;
+#endif
+#if QT_DEPRECATED_SINCE(5,15)
+ QT_DEPRECATED_VERSION_X_5_15("Use QPageSize::id(windowsId) and setPageLayout(QPageSize) instead.")
void setWinPageSize(int winPageSize);
+ QT_DEPRECATED_VERSION_X_5_15("Use pageLayout.pageSize().windowsId() instead.")
int winPageSize() const;
+ QT_DEPRECATED_VERSION_X_5_15("Use pageLayout().fullRectPixels(resolution()) instead.")
QRect paperRect() const;
+ QT_DEPRECATED_VERSION_X_5_15("Use pageLayout().paintRectPixels(resolution()) instead.")
QRect pageRect() const;
+#endif
QRectF paperRect(Unit) const;
QRectF pageRect(Unit) const;
@@ -255,10 +282,15 @@ public:
void setPrintRange(PrintRange range);
PrintRange printRange() const;
+#if QT_DEPRECATED_SINCE(5,15)
+ QT_DEPRECATED_VERSION_X_5_15("Use setPageMargins(QMarginsF, QPageLayout::Unit) instead.")
void setMargins(const QMarginsF &m) override;
+ QT_DEPRECATED_VERSION_X_5_15("Use setPageMargins(QMarginsF, QPageLayout::Unit) instead.")
void setPageMargins(qreal left, qreal top, qreal right, qreal bottom, Unit unit);
+ QT_DEPRECATED_VERSION_X_5_15("Use pageLayout().pageMargins() instead.")
void getPageMargins(qreal *left, qreal *top, qreal *right, qreal *bottom, Unit unit) const;
+#endif
protected:
int metric(PaintDeviceMetric) const override;