diff options
Diffstat (limited to 'src/printsupport')
-rw-r--r-- | src/printsupport/kernel/qplatformprintdevice.cpp | 5 | ||||
-rw-r--r-- | src/printsupport/kernel/qplatformprintdevice.h | 7 | ||||
-rw-r--r-- | src/printsupport/kernel/qplatformprintplugin.h | 2 | ||||
-rw-r--r-- | src/printsupport/kernel/qprintdevice.cpp | 2 | ||||
-rw-r--r-- | src/printsupport/kernel/qprintdevice_p.h | 2 | ||||
-rw-r--r-- | src/printsupport/kernel/qprinter.cpp | 4 | ||||
-rw-r--r-- | src/printsupport/widgets/qprintpreviewwidget.cpp | 4 |
7 files changed, 9 insertions, 17 deletions
diff --git a/src/printsupport/kernel/qplatformprintdevice.cpp b/src/printsupport/kernel/qplatformprintdevice.cpp index bd6d81774c..6385f58aa1 100644 --- a/src/printsupport/kernel/qplatformprintdevice.cpp +++ b/src/printsupport/kernel/qplatformprintdevice.cpp @@ -75,11 +75,6 @@ QPlatformPrintDevice::~QPlatformPrintDevice() { } -bool QPlatformPrintDevice::operator==(const QPlatformPrintDevice &other) const -{ - return m_id == other.m_id; -} - QString QPlatformPrintDevice::id() const { return m_id; diff --git a/src/printsupport/kernel/qplatformprintdevice.h b/src/printsupport/kernel/qplatformprintdevice.h index 1e21e608ad..8bb87a70f9 100644 --- a/src/printsupport/kernel/qplatformprintdevice.h +++ b/src/printsupport/kernel/qplatformprintdevice.h @@ -55,17 +55,14 @@ QT_BEGIN_NAMESPACE #ifndef QT_NO_PRINTER -class Q_PRINTSUPPORT_EXPORT QPlatformPrintDevice : public QSharedData +class Q_PRINTSUPPORT_EXPORT QPlatformPrintDevice { + Q_DISABLE_COPY(QPlatformPrintDevice) public: QPlatformPrintDevice(); explicit QPlatformPrintDevice(const QString &id); virtual ~QPlatformPrintDevice(); - QPlatformPrintDevice *clone(); - - bool operator==(const QPlatformPrintDevice &other) const; - virtual QString id() const; virtual QString name() const; virtual QString location() const; diff --git a/src/printsupport/kernel/qplatformprintplugin.h b/src/printsupport/kernel/qplatformprintplugin.h index 279de9b952..ad39bf5a0c 100644 --- a/src/printsupport/kernel/qplatformprintplugin.h +++ b/src/printsupport/kernel/qplatformprintplugin.h @@ -52,7 +52,7 @@ QT_BEGIN_NAMESPACE class QPlatformPrinterSupport; -#define QPlatformPrinterSupportFactoryInterface_iid "org.qt-project.QPlatformPrinterSupportFactoryInterface" +#define QPlatformPrinterSupportFactoryInterface_iid "org.qt-project.QPlatformPrinterSupportFactoryInterface.5.1" class Q_PRINTSUPPORT_EXPORT QPlatformPrinterSupportPlugin : public QObject { diff --git a/src/printsupport/kernel/qprintdevice.cpp b/src/printsupport/kernel/qprintdevice.cpp index 7c18b53e09..a640c14483 100644 --- a/src/printsupport/kernel/qprintdevice.cpp +++ b/src/printsupport/kernel/qprintdevice.cpp @@ -73,7 +73,7 @@ QPrintDevice &QPrintDevice::operator=(const QPrintDevice &other) bool QPrintDevice::operator==(const QPrintDevice &other) const { if (d && other.d) - return *d == *other.d; + return d->id() == other.d->id(); return d == other.d; } diff --git a/src/printsupport/kernel/qprintdevice_p.h b/src/printsupport/kernel/qprintdevice_p.h index ad55cded0e..ddf5595734 100644 --- a/src/printsupport/kernel/qprintdevice_p.h +++ b/src/printsupport/kernel/qprintdevice_p.h @@ -136,7 +136,7 @@ private: friend class QPlatformPrinterSupport; friend class QPlatformPrintDevice; QPrintDevice(QPlatformPrintDevice *dd); - QSharedDataPointer<QPlatformPrintDevice> d; + QSharedPointer<QPlatformPrintDevice> d; }; Q_DECLARE_SHARED(QPrintDevice) diff --git a/src/printsupport/kernel/qprinter.cpp b/src/printsupport/kernel/qprinter.cpp index 246dae0ddf..a106a58502 100644 --- a/src/printsupport/kernel/qprinter.cpp +++ b/src/printsupport/kernel/qprinter.cpp @@ -1764,7 +1764,7 @@ QRectF QPrinter::paperRect(Unit unit) const } /*! - \obsolete Use pageLayout().paintRect() instead. + \obsolete Use pageLayout().paintRectPixels(resolution()) instead. Returns the page's rectangle; this is usually smaller than the paperRect() since the page normally has margins between its @@ -1781,7 +1781,7 @@ QRect QPrinter::pageRect() const } /*! - \obsolete Use pageLayout().fullPageRect() instead. + \obsolete Use pageLayout().fullRectPixels(resolution()) instead. Returns the paper's rectangle; this is usually larger than the pageRect(). diff --git a/src/printsupport/widgets/qprintpreviewwidget.cpp b/src/printsupport/widgets/qprintpreviewwidget.cpp index 6033381b58..686dab07bf 100644 --- a/src/printsupport/widgets/qprintpreviewwidget.cpp +++ b/src/printsupport/widgets/qprintpreviewwidget.cpp @@ -335,8 +335,8 @@ void QPrintPreviewWidgetPrivate::populateScene() pages.clear(); int numPages = pictures.count(); - QSize paperSize = printer->paperRect().size(); - QRect pageRect = printer->pageRect(); + QSize paperSize = printer->pageLayout().fullRectPixels(printer->resolution()).size(); + QRect pageRect = printer->pageLayout().paintRectPixels(printer->resolution()); for (int i = 0; i < numPages; i++) { PageItem* item = new PageItem(i+1, pictures.at(i), paperSize, pageRect); |