1
0
forked from pool/libqt5-qtbase
libqt5-qtbase/0007-Introduce-QPrintDevice-property-setProperty.patch
Dominique Leuenberger 69da80a0af Accepting request 558896 from KDE:Qt5
- Add 0001-Fix-custom-page-size-handling-in-the-Unix-print-dial.patch
  to fix custom page size handling in the Unix print dialog (QTBUG-58733) 

- Add patches from upstream to reintroduce the advanced tab in
  the Qt printer properties dialog:
  0001-Remove-QPrintDialogPrivate-applyPrinterProperties-no.patch 
  0002-Remove-QUnixPrintWidgetPrivate-applyPrinterPropertie.patch
  0003-Remove-QPrintPropertiesDialog-applyPrinterProperties.patch
  0004-Remove-QCupsJobWidget-setPrinter.patch
  0005-Remove-QPrintPropertiesDialog-selectPrinter.patch
  0006-Remove-QPageSetupWidget-selectPrinter.patch
  0007-Introduce-QPrintDevice-property-setProperty.patch
  0008-Allow-access-to-ppd-file-and-ppdMarkOption-via-QPpdP.patch
  0009-QPlatformPrintDevice-use-QVector-not-QList-in-the-AP.patch
  0010-Reintroduce-the-Advanced-tab-in-the-QPrintProperties.patch
  0011-QtPrintSupport-Fix-build.patch 
- Small change in 0001-Add-remote-print-queue-support.patch so
  0007-Allow-access-to-ppd-file-and-ppdMarkOption-via-QPpdP.patch
  applies cleanly.

- Update the license tag (boo#967696)

- Update to 5.10.0 final
  * New bugfix release

- Update to 5.10.0 RC 2
  * New bugfix release

- Update to 5.10.0 RC 1
  * New bugfix release

OBS-URL: https://build.opensuse.org/request/show/558896
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libqt5-qtbase?expand=0&rev=71
2017-12-23 11:15:29 +00:00

114 lines
3.8 KiB
Diff

From 70f6a35c8f0b6a73f4d568532e1365cd3e8ff8dd Mon Sep 17 00:00:00 2001
From: Albert Astals Cid <albert.astals.cid@kdab.com>
Date: Mon, 4 Dec 2017 13:23:49 +0100
Subject: [PATCH 37/54] Introduce QPrintDevice::property/setProperty
So we can access QPlatformPrintDevice internals if needed
Change-Id: Ib37c5717713f37262ef12d7b61793d80f05baf4a
Reviewed-by: Liang Qi <liang.qi@qt.io>
---
src/printsupport/kernel/qplatformprintdevice.cpp | 15 +++++++++++++++
src/printsupport/kernel/qplatformprintdevice.h | 6 ++++++
src/printsupport/kernel/qprintdevice.cpp | 10 ++++++++++
src/printsupport/kernel/qprintdevice_p.h | 7 +++++++
4 files changed, 38 insertions(+)
diff --git a/src/printsupport/kernel/qplatformprintdevice.cpp b/src/printsupport/kernel/qplatformprintdevice.cpp
index e2d4a08de3..ad3f923bec 100644
--- a/src/printsupport/kernel/qplatformprintdevice.cpp
+++ b/src/printsupport/kernel/qplatformprintdevice.cpp
@@ -381,6 +381,21 @@ void QPlatformPrintDevice::loadMimeTypes() const
{
}
+QVariant QPlatformPrintDevice::property(QPrintDevice::PrintDevicePropertyKey key) const
+{
+ Q_UNUSED(key)
+
+ return QVariant();
+}
+
+bool QPlatformPrintDevice::setProperty(QPrintDevice::PrintDevicePropertyKey key, const QVariant &value)
+{
+ Q_UNUSED(key)
+ Q_UNUSED(value)
+
+ return false;
+}
+
QList<QMimeType> QPlatformPrintDevice::supportedMimeTypes() const
{
if (!m_haveMimeTypes)
diff --git a/src/printsupport/kernel/qplatformprintdevice.h b/src/printsupport/kernel/qplatformprintdevice.h
index 44a3a966f4..654bb123fb 100644
--- a/src/printsupport/kernel/qplatformprintdevice.h
+++ b/src/printsupport/kernel/qplatformprintdevice.h
@@ -53,11 +53,14 @@
#include <QtPrintSupport/qtprintsupportglobal.h>
#include <private/qprint_p.h>
+#include <private/qprintdevice_p.h>
+#include <QtCore/qvariant.h>
#include <QtCore/qvector.h>
#include <QtCore/qmimetype.h>
#include <QtGui/qpagelayout.h>
+
QT_BEGIN_NAMESPACE
#ifndef QT_NO_PRINTER
@@ -118,6 +121,9 @@ public:
virtual QPrint::ColorMode defaultColorMode() const;
virtual QList<QPrint::ColorMode> supportedColorModes() const;
+ virtual QVariant property(QPrintDevice::PrintDevicePropertyKey key) const;
+ virtual bool setProperty(QPrintDevice::PrintDevicePropertyKey key, const QVariant &value);
+
#ifndef QT_NO_MIMETYPE
virtual QList<QMimeType> supportedMimeTypes() const;
#endif
diff --git a/src/printsupport/kernel/qprintdevice.cpp b/src/printsupport/kernel/qprintdevice.cpp
index 26799a6f13..7096f5a2f6 100644
--- a/src/printsupport/kernel/qprintdevice.cpp
+++ b/src/printsupport/kernel/qprintdevice.cpp
@@ -245,6 +245,16 @@ QList<QPrint::ColorMode> QPrintDevice::supportedColorModes() const
return isValid() ? d->supportedColorModes() : QList<QPrint::ColorMode>();
}
+QVariant QPrintDevice::property(PrintDevicePropertyKey key) const
+{
+ return isValid() ? d->property(key) : QVariant();
+}
+
+bool QPrintDevice::setProperty(PrintDevicePropertyKey key, const QVariant &value)
+{
+ return isValid() ? d->setProperty(key, value) : false;
+}
+
#ifndef QT_NO_MIMETYPE
QList<QMimeType> QPrintDevice::supportedMimeTypes() const
{
diff --git a/src/printsupport/kernel/qprintdevice_p.h b/src/printsupport/kernel/qprintdevice_p.h
index 1e0d3983e9..1a26d3afcf 100644
--- a/src/printsupport/kernel/qprintdevice_p.h
+++ b/src/printsupport/kernel/qprintdevice_p.h
@@ -131,6 +131,13 @@ public:
QPrint::ColorMode defaultColorMode() const;
QList<QPrint::ColorMode> supportedColorModes() const;
+ enum PrintDevicePropertyKey {
+ PDPK_CustomBase = 0xff00
+ };
+
+ QVariant property(PrintDevicePropertyKey key) const;
+ bool setProperty(PrintDevicePropertyKey key, const QVariant &value);
+
#ifndef QT_NO_MIMETYPE
QList<QMimeType> supportedMimeTypes() const;
#endif
--
2.15.1