diff options
Diffstat (limited to 'src/printsupport')
-rw-r--r-- | src/printsupport/dialogs/qprintdialog_mac.mm | 2 | ||||
-rw-r--r-- | src/printsupport/kernel/qprinter.h | 34 | ||||
-rw-r--r-- | src/printsupport/widgets/qprintpreviewwidget.cpp | 8 |
3 files changed, 39 insertions, 5 deletions
diff --git a/src/printsupport/dialogs/qprintdialog_mac.mm b/src/printsupport/dialogs/qprintdialog_mac.mm index 9f84f98588..219a7a1f30 100644 --- a/src/printsupport/dialogs/qprintdialog_mac.mm +++ b/src/printsupport/dialogs/qprintdialog_mac.mm @@ -204,7 +204,7 @@ QT_USE_NAMESPACE } if (pageSize.isValid() && !pageSize.isEquivalentTo(printer->pageLayout().pageSize())) printer->setPageSize(pageSize); - printer->setOrientation(orientation == kPMLandscape ? QPrinter::Landscape : QPrinter::Portrait); + printer->setPageOrientation(orientation == kPMLandscape ? QPageLayout::Landscape : QPageLayout::Portrait); dialog->done((returnCode == NSModalResponseOK) ? QDialog::Accepted : QDialog::Rejected); } 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; diff --git a/src/printsupport/widgets/qprintpreviewwidget.cpp b/src/printsupport/widgets/qprintpreviewwidget.cpp index 16b84e328d..bd22d5a6a5 100644 --- a/src/printsupport/widgets/qprintpreviewwidget.cpp +++ b/src/printsupport/widgets/qprintpreviewwidget.cpp @@ -357,7 +357,7 @@ void QPrintPreviewWidgetPrivate::layoutPages() int numPagePlaces = numPages; int cols = 1; // singleMode and default if (viewMode == QPrintPreviewWidget::AllPagesView) { - if (printer->orientation() == QPrinter::Portrait) + if (printer->pageLayout().orientation() == QPageLayout::Portrait) cols = qCeil(qSqrt((float) numPages)); else cols = qFloor(qSqrt((float) numPages)); @@ -593,7 +593,8 @@ void QPrintPreviewWidget::setViewMode(ViewMode mode) QPrinter::Orientation QPrintPreviewWidget::orientation() const { Q_D(const QPrintPreviewWidget); - return d->printer->orientation(); + return d->printer->pageLayout().orientation() == QPageLayout::Portrait + ? QPrinter::Portrait : QPrinter::Landscape; } /*! @@ -603,7 +604,8 @@ QPrinter::Orientation QPrintPreviewWidget::orientation() const void QPrintPreviewWidget::setOrientation(QPrinter::Orientation orientation) { Q_D(QPrintPreviewWidget); - d->printer->setOrientation(orientation); + d->printer->setPageOrientation(orientation == QPrinter::Portrait + ? QPageLayout::Portrait : QPageLayout::Landscape); d->generatePreview(); } |