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
This commit is contained in:
parent
2906587d73
commit
69da80a0af
@ -18,10 +18,10 @@ Change-Id: Ib70715d331e8f380a3c9039011bb8521986652aa
|
|||||||
src/plugins/printsupport/cups/qppdprintdevice.cpp | 33 +++++++-
|
src/plugins/printsupport/cups/qppdprintdevice.cpp | 33 +++++++-
|
||||||
4 files changed, 160 insertions(+), 11 deletions(-)
|
4 files changed, 160 insertions(+), 11 deletions(-)
|
||||||
|
|
||||||
diff --git a/src/plugins/printsupport/cups/qcupsprintengine.cpp b/src/plugins/printsupport/cups/qcupsprintengine.cpp
|
Index: qtbase-everywhere-src-5.10.0/src/plugins/printsupport/cups/qcupsprintengine.cpp
|
||||||
index a16eb3abb5..6dc123fb51 100644
|
===================================================================
|
||||||
--- a/src/plugins/printsupport/cups/qcupsprintengine.cpp
|
--- qtbase-everywhere-src-5.10.0.orig/src/plugins/printsupport/cups/qcupsprintengine.cpp
|
||||||
+++ b/src/plugins/printsupport/cups/qcupsprintengine.cpp
|
+++ qtbase-everywhere-src-5.10.0/src/plugins/printsupport/cups/qcupsprintengine.cpp
|
||||||
@@ -48,6 +48,7 @@
|
@@ -48,6 +48,7 @@
|
||||||
#include <qbuffer.h>
|
#include <qbuffer.h>
|
||||||
#include "private/qcups_p.h" // Only needed for PPK_CupsOptions
|
#include "private/qcups_p.h" // Only needed for PPK_CupsOptions
|
||||||
@ -30,7 +30,7 @@ index a16eb3abb5..6dc123fb51 100644
|
|||||||
|
|
||||||
#include <cups/cups.h>
|
#include <cups/cups.h>
|
||||||
|
|
||||||
@@ -241,8 +242,40 @@ void QCupsPrintEnginePrivate::closePrintDevice()
|
@@ -241,8 +242,40 @@ void QCupsPrintEnginePrivate::closePrint
|
||||||
|
|
||||||
// Print the file.
|
// Print the file.
|
||||||
cups_option_t* optPtr = cupsOptStruct.size() ? &cupsOptStruct.first() : 0;
|
cups_option_t* optPtr = cupsOptStruct.size() ? &cupsOptStruct.first() : 0;
|
||||||
@ -72,10 +72,10 @@ index a16eb3abb5..6dc123fb51 100644
|
|||||||
|
|
||||||
QFile::remove(tempFile);
|
QFile::remove(tempFile);
|
||||||
}
|
}
|
||||||
diff --git a/src/plugins/printsupport/cups/qcupsprintersupport.cpp b/src/plugins/printsupport/cups/qcupsprintersupport.cpp
|
Index: qtbase-everywhere-src-5.10.0/src/plugins/printsupport/cups/qcupsprintersupport.cpp
|
||||||
index 1887625406..a145beaf18 100644
|
===================================================================
|
||||||
--- a/src/plugins/printsupport/cups/qcupsprintersupport.cpp
|
--- qtbase-everywhere-src-5.10.0.orig/src/plugins/printsupport/cups/qcupsprintersupport.cpp
|
||||||
+++ b/src/plugins/printsupport/cups/qcupsprintersupport.cpp
|
+++ qtbase-everywhere-src-5.10.0/src/plugins/printsupport/cups/qcupsprintersupport.cpp
|
||||||
@@ -52,6 +52,35 @@
|
@@ -52,6 +52,35 @@
|
||||||
# include <cups/language.h>
|
# include <cups/language.h>
|
||||||
#endif
|
#endif
|
||||||
@ -112,7 +112,7 @@ index 1887625406..a145beaf18 100644
|
|||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
QCupsPrinterSupport::QCupsPrinterSupport()
|
QCupsPrinterSupport::QCupsPrinterSupport()
|
||||||
@@ -81,17 +110,35 @@ QPrintDevice QCupsPrinterSupport::createPrintDevice(const QString &id)
|
@@ -81,17 +110,35 @@ QPrintDevice QCupsPrinterSupport::create
|
||||||
|
|
||||||
QStringList QCupsPrinterSupport::availablePrintDeviceIds() const
|
QStringList QCupsPrinterSupport::availablePrintDeviceIds() const
|
||||||
{
|
{
|
||||||
@ -153,7 +153,7 @@ index 1887625406..a145beaf18 100644
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,8 +146,18 @@ QString QCupsPrinterSupport::defaultPrintDeviceId() const
|
@@ -99,8 +146,18 @@ QString QCupsPrinterSupport::defaultPrin
|
||||||
{
|
{
|
||||||
QString printerId;
|
QString printerId;
|
||||||
cups_dest_t *dests;
|
cups_dest_t *dests;
|
||||||
@ -174,7 +174,7 @@ index 1887625406..a145beaf18 100644
|
|||||||
if (dests[i].is_default) {
|
if (dests[i].is_default) {
|
||||||
printerId = QString::fromLocal8Bit(dests[i].name);
|
printerId = QString::fromLocal8Bit(dests[i].name);
|
||||||
if (dests[i].instance) {
|
if (dests[i].instance) {
|
||||||
@@ -109,8 +166,30 @@ QString QCupsPrinterSupport::defaultPrintDeviceId() const
|
@@ -109,8 +166,30 @@ QString QCupsPrinterSupport::defaultPrin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -206,10 +206,10 @@ index 1887625406..a145beaf18 100644
|
|||||||
+
|
+
|
||||||
+
|
+
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
diff --git a/src/plugins/printsupport/cups/qcupsprintersupport_p.h b/src/plugins/printsupport/cups/qcupsprintersupport_p.h
|
Index: qtbase-everywhere-src-5.10.0/src/plugins/printsupport/cups/qcupsprintersupport_p.h
|
||||||
index 13f64b5e69..81eaa09882 100644
|
===================================================================
|
||||||
--- a/src/plugins/printsupport/cups/qcupsprintersupport_p.h
|
--- qtbase-everywhere-src-5.10.0.orig/src/plugins/printsupport/cups/qcupsprintersupport_p.h
|
||||||
+++ b/src/plugins/printsupport/cups/qcupsprintersupport_p.h
|
+++ qtbase-everywhere-src-5.10.0/src/plugins/printsupport/cups/qcupsprintersupport_p.h
|
||||||
@@ -56,6 +56,8 @@
|
@@ -56,6 +56,8 @@
|
||||||
|
|
||||||
#include <QtCore/qstringlist.h>
|
#include <QtCore/qstringlist.h>
|
||||||
@ -234,18 +234,18 @@ index 13f64b5e69..81eaa09882 100644
|
|||||||
};
|
};
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
diff --git a/src/plugins/printsupport/cups/qppdprintdevice.cpp b/src/plugins/printsupport/cups/qppdprintdevice.cpp
|
Index: qtbase-everywhere-src-5.10.0/src/plugins/printsupport/cups/qppdprintdevice.cpp
|
||||||
index 9efa83d409..5b7222902d 100644
|
===================================================================
|
||||||
--- a/src/plugins/printsupport/cups/qppdprintdevice.cpp
|
--- qtbase-everywhere-src-5.10.0.orig/src/plugins/printsupport/cups/qppdprintdevice.cpp
|
||||||
+++ b/src/plugins/printsupport/cups/qppdprintdevice.cpp
|
+++ qtbase-everywhere-src-5.10.0/src/plugins/printsupport/cups/qppdprintdevice.cpp
|
||||||
@@ -41,6 +41,7 @@
|
@@ -39,6 +39,7 @@
|
||||||
|
|
||||||
|
#include "qppdprintdevice.h"
|
||||||
|
|
||||||
|
+#include "qcupsprintersupport_p.h"
|
||||||
#include <QtCore/QMimeDatabase>
|
#include <QtCore/QMimeDatabase>
|
||||||
#include <qdebug.h>
|
#include <qdebug.h>
|
||||||
+#include "qcupsprintersupport_p.h"
|
|
||||||
|
|
||||||
#ifndef QT_LINUXBASE // LSB merges everything into cups.h
|
|
||||||
#include <cups/language.h>
|
|
||||||
@@ -451,10 +452,38 @@ void QPpdPrintDevice::loadPrinter()
|
@@ -451,10 +452,38 @@ void QPpdPrintDevice::loadPrinter()
|
||||||
m_cupsDest = 0;
|
m_cupsDest = 0;
|
||||||
}
|
}
|
||||||
@ -287,6 +287,3 @@ index 9efa83d409..5b7222902d 100644
|
|||||||
if (ppdFile) {
|
if (ppdFile) {
|
||||||
m_ppd = ppdOpenFile(ppdFile);
|
m_ppd = ppdOpenFile(ppdFile);
|
||||||
unlink(ppdFile);
|
unlink(ppdFile);
|
||||||
--
|
|
||||||
2.13.0
|
|
||||||
|
|
||||||
|
127
0001-Fix-custom-page-size-handling-in-the-Unix-print-dial.patch
Normal file
127
0001-Fix-custom-page-size-handling-in-the-Unix-print-dial.patch
Normal file
@ -0,0 +1,127 @@
|
|||||||
|
From 49c7939b6b3472af756412324442170d0af5d08f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Albert Astals Cid <albert.astals.cid@kdab.com>
|
||||||
|
Date: Wed, 20 Dec 2017 10:41:33 +0100
|
||||||
|
Subject: [PATCH] Fix custom page size handling in the Unix print dialog
|
||||||
|
|
||||||
|
There were several problems that i've fixed in a single commit since they are very interwinded
|
||||||
|
|
||||||
|
* The dialog used QPageSize::Custom for two things, the custom sizes coming from
|
||||||
|
the printer and the "user can write whatever size they want" size. Now only
|
||||||
|
the printer custom sizes use QPageSize::Custom and we use m_realCustomPageSizeIndex
|
||||||
|
for the "user can write whatever size they want" one.
|
||||||
|
|
||||||
|
* The dialog stored the QPageSize id as the combo userData, that doesn't work
|
||||||
|
when the printer has multiple custom sizes since they all share QPageSize::Custom
|
||||||
|
so now it stores the QPageSize itself
|
||||||
|
|
||||||
|
Task-number: QTBUG-58733
|
||||||
|
Change-Id: Ie640a07bb5e24b753db83c091c836e8af4ff126c
|
||||||
|
---
|
||||||
|
src/printsupport/dialogs/qpagesetupdialog_unix.cpp | 30 ++++++++++++++--------
|
||||||
|
src/printsupport/dialogs/qpagesetupdialog_unix_p.h | 1 +
|
||||||
|
2 files changed, 20 insertions(+), 11 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/printsupport/dialogs/qpagesetupdialog_unix.cpp b/src/printsupport/dialogs/qpagesetupdialog_unix.cpp
|
||||||
|
index 6f3bb0dd55..55ac913df8 100644
|
||||||
|
--- a/src/printsupport/dialogs/qpagesetupdialog_unix.cpp
|
||||||
|
+++ b/src/printsupport/dialogs/qpagesetupdialog_unix.cpp
|
||||||
|
@@ -234,10 +234,14 @@ QPageSetupWidget::QPageSetupWidget(QWidget *parent)
|
||||||
|
m_printer(0),
|
||||||
|
m_outputFormat(QPrinter::PdfFormat),
|
||||||
|
m_units(QPageLayout::Point),
|
||||||
|
- m_blockSignals(false)
|
||||||
|
+ m_blockSignals(false),
|
||||||
|
+ m_realCustomPageSizeIndex(-1)
|
||||||
|
{
|
||||||
|
m_ui.setupUi(this);
|
||||||
|
|
||||||
|
+ if (!QMetaType::hasRegisteredComparators<QPageSize>())
|
||||||
|
+ QMetaType::registerEqualsComparator<QPageSize>();
|
||||||
|
+
|
||||||
|
QVBoxLayout *lay = new QVBoxLayout(m_ui.preview);
|
||||||
|
m_pagePreview = new QPagePreview(m_ui.preview);
|
||||||
|
m_pagePreview->setPagePreviewLayout(1, 1);
|
||||||
|
@@ -341,15 +345,18 @@ void QPageSetupWidget::initPageSizes()
|
||||||
|
|
||||||
|
m_ui.pageSizeCombo->clear();
|
||||||
|
|
||||||
|
+ m_realCustomPageSizeIndex = -1;
|
||||||
|
+
|
||||||
|
if (m_outputFormat == QPrinter::NativeFormat && !m_printerName.isEmpty()) {
|
||||||
|
QPlatformPrinterSupport *ps = QPlatformPrinterSupportPlugin::get();
|
||||||
|
if (ps) {
|
||||||
|
QPrintDevice printDevice = ps->createPrintDevice(m_printerName);
|
||||||
|
const auto pageSizes = printDevice.supportedPageSizes();
|
||||||
|
for (const QPageSize &pageSize : pageSizes)
|
||||||
|
- m_ui.pageSizeCombo->addItem(pageSize.name(), QVariant::fromValue(pageSize.id()));
|
||||||
|
+ m_ui.pageSizeCombo->addItem(pageSize.name(), QVariant::fromValue(pageSize));
|
||||||
|
if (m_ui.pageSizeCombo->count() > 0 && printDevice.supportsCustomPageSizes()) {
|
||||||
|
- m_ui.pageSizeCombo->addItem(tr("Custom"), QVariant::fromValue(QPageSize::Custom));
|
||||||
|
+ m_ui.pageSizeCombo->addItem(tr("Custom"));
|
||||||
|
+ m_realCustomPageSizeIndex = m_ui.pageSizeCombo->count() - 1;
|
||||||
|
m_blockSignals = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
@@ -359,10 +366,11 @@ void QPageSetupWidget::initPageSizes()
|
||||||
|
// If PdfFormat or no available printer page sizes, populate with all page sizes
|
||||||
|
for (int id = 0; id < QPageSize::LastPageSize; ++id) {
|
||||||
|
if (QPageSize::PageSizeId(id) == QPageSize::Custom) {
|
||||||
|
- m_ui.pageSizeCombo->addItem(tr("Custom"), QVariant::fromValue(QPageSize::Custom));
|
||||||
|
+ m_ui.pageSizeCombo->addItem(tr("Custom"));
|
||||||
|
+ m_realCustomPageSizeIndex = m_ui.pageSizeCombo->count() - 1;
|
||||||
|
} else {
|
||||||
|
QPageSize pageSize = QPageSize(QPageSize::PageSizeId(id));
|
||||||
|
- m_ui.pageSizeCombo->addItem(pageSize.name(), QVariant::fromValue(pageSize.id()));
|
||||||
|
+ m_ui.pageSizeCombo->addItem(pageSize.name(), QVariant::fromValue(pageSize));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -434,7 +442,9 @@ void QPageSetupWidget::updateWidget()
|
||||||
|
|
||||||
|
m_ui.unitCombo->setCurrentIndex(m_ui.unitCombo->findData(QVariant::fromValue(m_units)));
|
||||||
|
|
||||||
|
- m_ui.pageSizeCombo->setCurrentIndex(m_ui.pageSizeCombo->findData(QVariant::fromValue(m_pageLayout.pageSize().id())));
|
||||||
|
+ const bool isCustom = m_ui.pageSizeCombo->currentIndex() == m_realCustomPageSizeIndex && m_realCustomPageSizeIndex != -1;
|
||||||
|
+ if (!isCustom)
|
||||||
|
+ m_ui.pageSizeCombo->setCurrentIndex(m_ui.pageSizeCombo->findData(QVariant::fromValue(m_pageLayout.pageSize())));
|
||||||
|
|
||||||
|
QMarginsF min;
|
||||||
|
QMarginsF max;
|
||||||
|
@@ -467,8 +477,6 @@ void QPageSetupWidget::updateWidget()
|
||||||
|
m_ui.bottomMargin->setMaximum(max.bottom());
|
||||||
|
m_ui.bottomMargin->setValue(m_pageLayout.margins().bottom());
|
||||||
|
|
||||||
|
- bool isCustom = m_ui.pageSizeCombo->currentData().value<QPageSize::PageSizeId>() == QPageSize::Custom;
|
||||||
|
-
|
||||||
|
m_ui.pageWidth->setSuffix(suffix);
|
||||||
|
m_ui.pageWidth->setValue(m_pageLayout.fullRect(m_units).width());
|
||||||
|
m_ui.pageWidth->setEnabled(isCustom);
|
||||||
|
@@ -513,10 +521,10 @@ void QPageSetupWidget::pageSizeChanged()
|
||||||
|
if (m_blockSignals)
|
||||||
|
return;
|
||||||
|
|
||||||
|
- QPageSize::PageSizeId id = m_ui.pageSizeCombo->currentData().value<QPageSize::PageSizeId>();
|
||||||
|
- if (id != QPageSize::Custom) {
|
||||||
|
+ if (m_ui.pageSizeCombo->currentIndex() != m_realCustomPageSizeIndex) {
|
||||||
|
+ const QPageSize pageSize = m_ui.pageSizeCombo->currentData().value<QPageSize>();
|
||||||
|
// TODO Set layout margin min/max to printer custom min/max
|
||||||
|
- m_pageLayout.setPageSize(QPageSize(id));
|
||||||
|
+ m_pageLayout.setPageSize(pageSize);
|
||||||
|
} else {
|
||||||
|
QSizeF customSize;
|
||||||
|
if (m_pageLayout.orientation() == QPageLayout::Landscape)
|
||||||
|
diff --git a/src/printsupport/dialogs/qpagesetupdialog_unix_p.h b/src/printsupport/dialogs/qpagesetupdialog_unix_p.h
|
||||||
|
index 574569de29..292cccd7ea 100644
|
||||||
|
--- a/src/printsupport/dialogs/qpagesetupdialog_unix_p.h
|
||||||
|
+++ b/src/printsupport/dialogs/qpagesetupdialog_unix_p.h
|
||||||
|
@@ -102,6 +102,7 @@ private:
|
||||||
|
QPageLayout m_pageLayout;
|
||||||
|
QPageLayout::Unit m_units;
|
||||||
|
bool m_blockSignals;
|
||||||
|
+ int m_realCustomPageSizeIndex;
|
||||||
|
};
|
||||||
|
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
--
|
||||||
|
2.15.1
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,41 @@
|
|||||||
|
From 2ecfdf87b8362309f555e441f16e6c5b56f17e63 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Albert Astals Cid <albert.astals.cid@kdab.com>
|
||||||
|
Date: Mon, 4 Dec 2017 12:42:54 +0100
|
||||||
|
Subject: [PATCH 02/54] Remove QPrintDialogPrivate::applyPrinterProperties, no
|
||||||
|
one calls it
|
||||||
|
|
||||||
|
Change-Id: Ic140f62e5cb63c6a4b7f4fa10ca243d8bb055c4e
|
||||||
|
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
|
||||||
|
---
|
||||||
|
src/printsupport/dialogs/qprintdialog_unix.cpp | 8 --------
|
||||||
|
1 file changed, 8 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp
|
||||||
|
index 183af7daa3..37a562125e 100644
|
||||||
|
--- a/src/printsupport/dialogs/qprintdialog_unix.cpp
|
||||||
|
+++ b/src/printsupport/dialogs/qprintdialog_unix.cpp
|
||||||
|
@@ -203,8 +203,6 @@ public:
|
||||||
|
~QPrintDialogPrivate();
|
||||||
|
|
||||||
|
void init();
|
||||||
|
- /// copy printer properties to the widget
|
||||||
|
- void applyPrinterProperties();
|
||||||
|
|
||||||
|
void selectPrinter(const QPrinter::OutputFormat outputFormat);
|
||||||
|
|
||||||
|
@@ -390,12 +388,6 @@ void QPrintDialogPrivate::selectPrinter(const QPrinter::OutputFormat outputForma
|
||||||
|
options.pageSetCombo->setEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
-void QPrintDialogPrivate::applyPrinterProperties()
|
||||||
|
-{
|
||||||
|
- // apply printer options to property dialog
|
||||||
|
- top->d->applyPrinterProperties();
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
void QPrintDialogPrivate::setupPrinter()
|
||||||
|
{
|
||||||
|
// First setup the requested OutputFormat, Printer and Page Size first
|
||||||
|
--
|
||||||
|
2.15.1
|
||||||
|
|
123
0002-Remove-QUnixPrintWidgetPrivate-applyPrinterPropertie.patch
Normal file
123
0002-Remove-QUnixPrintWidgetPrivate-applyPrinterPropertie.patch
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
From fb1836898f5f8f88accea92a5ad7adb625694700 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Albert Astals Cid <albert.astals.cid@kdab.com>
|
||||||
|
Date: Mon, 4 Dec 2017 12:49:12 +0100
|
||||||
|
Subject: [PATCH 03/54] Remove QUnixPrintWidgetPrivate::applyPrinterProperties
|
||||||
|
|
||||||
|
And move it's code to the only place it is called, the QUnixPrintWidget constructor,
|
||||||
|
that means we can remove the if that checks if propertiesDialog is not null since
|
||||||
|
at that stage we know it is null
|
||||||
|
|
||||||
|
Change-Id: I81cdaa0505fa6fe64a45c7d1f5c3e277400cbbf7
|
||||||
|
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
|
||||||
|
---
|
||||||
|
src/printsupport/dialogs/qprintdialog_unix.cpp | 80 +++++++++++---------------
|
||||||
|
1 file changed, 35 insertions(+), 45 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp
|
||||||
|
index 37a562125e..66d37dbec3 100644
|
||||||
|
--- a/src/printsupport/dialogs/qprintdialog_unix.cpp
|
||||||
|
+++ b/src/printsupport/dialogs/qprintdialog_unix.cpp
|
||||||
|
@@ -168,8 +168,6 @@ public:
|
||||||
|
QUnixPrintWidgetPrivate(QUnixPrintWidget *q, QPrinter *prn);
|
||||||
|
~QUnixPrintWidgetPrivate();
|
||||||
|
|
||||||
|
- /// copy printer properties to the widget
|
||||||
|
- void applyPrinterProperties();
|
||||||
|
bool checkFields();
|
||||||
|
void setupPrinter();
|
||||||
|
void setOptionsPane(QPrintDialogPrivate *pane);
|
||||||
|
@@ -790,48 +788,6 @@ void QUnixPrintWidgetPrivate::_q_btnBrowseClicked()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
-void QUnixPrintWidgetPrivate::applyPrinterProperties()
|
||||||
|
-{
|
||||||
|
- if (printer == nullptr)
|
||||||
|
- return;
|
||||||
|
- if (printer->outputFileName().isEmpty()) {
|
||||||
|
- QString home = QDir::homePath();
|
||||||
|
- QString cur = QDir::currentPath();
|
||||||
|
- if (home.at(home.length()-1) != QLatin1Char('/'))
|
||||||
|
- home += QLatin1Char('/');
|
||||||
|
- if (!cur.isEmpty() && cur.at(cur.length()-1) != QLatin1Char('/'))
|
||||||
|
- cur += QLatin1Char('/');
|
||||||
|
- if (!cur.startsWith(home))
|
||||||
|
- cur = home;
|
||||||
|
- if (QGuiApplication::platformName() == QLatin1String("xcb")) {
|
||||||
|
- if (printer->docName().isEmpty()) {
|
||||||
|
- cur += QLatin1String("print.pdf");
|
||||||
|
- } else {
|
||||||
|
- QRegExp re(QString::fromLatin1("(.*)\\.\\S+"));
|
||||||
|
- if (re.exactMatch(printer->docName()))
|
||||||
|
- cur += re.cap(1);
|
||||||
|
- else
|
||||||
|
- cur += printer->docName();
|
||||||
|
- cur += QLatin1String(".pdf");
|
||||||
|
- }
|
||||||
|
- } // xcb
|
||||||
|
-
|
||||||
|
- widget.filename->setText(cur);
|
||||||
|
- }
|
||||||
|
- else
|
||||||
|
- widget.filename->setText( printer->outputFileName() );
|
||||||
|
- QString printerName = printer->printerName();
|
||||||
|
- if (!printerName.isEmpty()) {
|
||||||
|
- const int i = widget.printers->findText(printerName);
|
||||||
|
- if (i >= 0)
|
||||||
|
- widget.printers->setCurrentIndex(i);
|
||||||
|
- }
|
||||||
|
- // PDF printer not added to the dialog yet, we'll handle those cases in QUnixPrintWidgetPrivate::updateWidget
|
||||||
|
-
|
||||||
|
- if (propertiesDialog)
|
||||||
|
- propertiesDialog->applyPrinterProperties(printer);
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
#if QT_CONFIG(messagebox)
|
||||||
|
bool QUnixPrintWidgetPrivate::checkFields()
|
||||||
|
{
|
||||||
|
@@ -951,7 +907,41 @@ void QUnixPrintWidgetPrivate::setupPrinter()
|
||||||
|
QUnixPrintWidget::QUnixPrintWidget(QPrinter *printer, QWidget *parent)
|
||||||
|
: QWidget(parent), d(new QUnixPrintWidgetPrivate(this, printer))
|
||||||
|
{
|
||||||
|
- d->applyPrinterProperties();
|
||||||
|
+ if (printer == nullptr)
|
||||||
|
+ return;
|
||||||
|
+ if (printer->outputFileName().isEmpty()) {
|
||||||
|
+ QString home = QDir::homePath();
|
||||||
|
+ QString cur = QDir::currentPath();
|
||||||
|
+ if (!home.endsWith(QLatin1Char('/')))
|
||||||
|
+ home += QLatin1Char('/');
|
||||||
|
+ if (!cur.startsWith(home))
|
||||||
|
+ cur = home;
|
||||||
|
+ else if (!cur.endsWith(QLatin1Char('/')))
|
||||||
|
+ cur += QLatin1Char('/');
|
||||||
|
+ if (QGuiApplication::platformName() == QStringLiteral("xcb")) {
|
||||||
|
+ if (printer->docName().isEmpty()) {
|
||||||
|
+ cur += QStringLiteral("print.pdf");
|
||||||
|
+ } else {
|
||||||
|
+ const QRegExp re(QStringLiteral("(.*)\\.\\S+"));
|
||||||
|
+ if (re.exactMatch(printer->docName()))
|
||||||
|
+ cur += re.cap(1);
|
||||||
|
+ else
|
||||||
|
+ cur += printer->docName();
|
||||||
|
+ cur += QStringLiteral(".pdf");
|
||||||
|
+ }
|
||||||
|
+ } // xcb
|
||||||
|
+
|
||||||
|
+ d->widget.filename->setText(cur);
|
||||||
|
+ }
|
||||||
|
+ else
|
||||||
|
+ d->widget.filename->setText(printer->outputFileName());
|
||||||
|
+ const QString printerName = printer->printerName();
|
||||||
|
+ if (!printerName.isEmpty()) {
|
||||||
|
+ const int i = d->widget.printers->findText(printerName);
|
||||||
|
+ if (i >= 0)
|
||||||
|
+ d->widget.printers->setCurrentIndex(i);
|
||||||
|
+ }
|
||||||
|
+ // PDF printer not added to the dialog yet, we'll handle those cases in QUnixPrintWidgetPrivate::updateWidget
|
||||||
|
}
|
||||||
|
|
||||||
|
/*! \internal
|
||||||
|
--
|
||||||
|
2.15.1
|
||||||
|
|
@ -0,0 +1,85 @@
|
|||||||
|
From f135d515e8d6aaf1c136aef68e08b4f759075310 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Albert Astals Cid <albert.astals.cid@kdab.com>
|
||||||
|
Date: Mon, 4 Dec 2017 12:53:04 +0100
|
||||||
|
Subject: [PATCH 04/54] Remove QPrintPropertiesDialog::applyPrinterProperties
|
||||||
|
|
||||||
|
It's only ever called after the constructor so merge its code to the constructor
|
||||||
|
|
||||||
|
Change-Id: Icca88764f725b9aeaa08ee7387da8885be247fba
|
||||||
|
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
|
||||||
|
---
|
||||||
|
src/printsupport/dialogs/qprintdialog_unix.cpp | 21 ++++++---------------
|
||||||
|
1 file changed, 6 insertions(+), 15 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp
|
||||||
|
index 66d37dbec3..6cccdd03cd 100644
|
||||||
|
--- a/src/printsupport/dialogs/qprintdialog_unix.cpp
|
||||||
|
+++ b/src/printsupport/dialogs/qprintdialog_unix.cpp
|
||||||
|
@@ -124,13 +124,11 @@ class QPrintPropertiesDialog : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
- QPrintPropertiesDialog(QAbstractPrintDialog *parent = nullptr);
|
||||||
|
+ QPrintPropertiesDialog(QPrinter *printer, QAbstractPrintDialog *parent = nullptr);
|
||||||
|
~QPrintPropertiesDialog();
|
||||||
|
|
||||||
|
void selectPrinter(QPrinter::OutputFormat outputFormat, const QString &printerName);
|
||||||
|
|
||||||
|
- /// copy printer properties to the widget
|
||||||
|
- void applyPrinterProperties(QPrinter *p);
|
||||||
|
void setupPrinter() const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
@@ -236,7 +234,7 @@ public:
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
-QPrintPropertiesDialog::QPrintPropertiesDialog(QAbstractPrintDialog *parent)
|
||||||
|
+QPrintPropertiesDialog::QPrintPropertiesDialog(QPrinter *printer, QAbstractPrintDialog *parent)
|
||||||
|
: QDialog(parent)
|
||||||
|
{
|
||||||
|
setWindowTitle(tr("Printer Properties"));
|
||||||
|
@@ -250,8 +248,11 @@ QPrintPropertiesDialog::QPrintPropertiesDialog(QAbstractPrintDialog *parent)
|
||||||
|
connect(m_buttons->button(QDialogButtonBox::Ok), SIGNAL(clicked()), this, SLOT(accept()));
|
||||||
|
connect(m_buttons->button(QDialogButtonBox::Cancel), SIGNAL(clicked()), this, SLOT(reject()));
|
||||||
|
|
||||||
|
+ widget.pageSetup->setPrinter(printer);
|
||||||
|
+
|
||||||
|
#if QT_CONFIG(cupsjobwidget)
|
||||||
|
m_jobOptions = new QCupsJobWidget();
|
||||||
|
+ m_jobOptions->setPrinter(printer);
|
||||||
|
widget.tabs->addTab(m_jobOptions, tr("Job Options"));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
@@ -260,14 +261,6 @@ QPrintPropertiesDialog::~QPrintPropertiesDialog()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
-void QPrintPropertiesDialog::applyPrinterProperties(QPrinter *p)
|
||||||
|
-{
|
||||||
|
- widget.pageSetup->setPrinter(p);
|
||||||
|
-#if QT_CONFIG(cupsjobwidget)
|
||||||
|
- m_jobOptions->setPrinter(p);
|
||||||
|
-#endif
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
void QPrintPropertiesDialog::setupPrinter() const
|
||||||
|
{
|
||||||
|
widget.pageSetup->setupPrinter();
|
||||||
|
@@ -846,12 +839,10 @@ void QUnixPrintWidgetPrivate::setupPrinterProperties()
|
||||||
|
if (propertiesDialog)
|
||||||
|
delete propertiesDialog;
|
||||||
|
|
||||||
|
- propertiesDialog = new QPrintPropertiesDialog(q);
|
||||||
|
+ propertiesDialog = new QPrintPropertiesDialog(q->printer(), q);
|
||||||
|
propertiesDialog->setResult(QDialog::Rejected);
|
||||||
|
propertiesDialogShown = false;
|
||||||
|
|
||||||
|
- propertiesDialog->applyPrinterProperties(q->printer());
|
||||||
|
-
|
||||||
|
if (q->isOptionEnabled(QPrintDialog::PrintToFile)
|
||||||
|
&& (widget.printers->currentIndex() == widget.printers->count() - 1)) {// PDF
|
||||||
|
propertiesDialog->selectPrinter(QPrinter::PdfFormat, QString());
|
||||||
|
--
|
||||||
|
2.15.1
|
||||||
|
|
75
0004-Remove-QCupsJobWidget-setPrinter.patch
Normal file
75
0004-Remove-QCupsJobWidget-setPrinter.patch
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
From 881690969cc5a6a78df41e2d80ea1fa7bf07cb27 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Albert Astals Cid <albert.astals.cid@kdab.com>
|
||||||
|
Date: Mon, 4 Dec 2017 12:57:40 +0100
|
||||||
|
Subject: [PATCH 05/54] Remove QCupsJobWidget::setPrinter
|
||||||
|
|
||||||
|
It is only ever called after the constructor so merge the code
|
||||||
|
|
||||||
|
Change-Id: I381165ad90c85342e5db3c16327d729388b71fb2
|
||||||
|
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
|
||||||
|
---
|
||||||
|
src/printsupport/dialogs/qprintdialog_unix.cpp | 3 +--
|
||||||
|
src/printsupport/widgets/qcupsjobwidget.cpp | 10 +++-------
|
||||||
|
src/printsupport/widgets/qcupsjobwidget_p.h | 3 +--
|
||||||
|
3 files changed, 5 insertions(+), 11 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp
|
||||||
|
index 6cccdd03cd..8c9997d572 100644
|
||||||
|
--- a/src/printsupport/dialogs/qprintdialog_unix.cpp
|
||||||
|
+++ b/src/printsupport/dialogs/qprintdialog_unix.cpp
|
||||||
|
@@ -251,8 +251,7 @@ QPrintPropertiesDialog::QPrintPropertiesDialog(QPrinter *printer, QAbstractPrint
|
||||||
|
widget.pageSetup->setPrinter(printer);
|
||||||
|
|
||||||
|
#if QT_CONFIG(cupsjobwidget)
|
||||||
|
- m_jobOptions = new QCupsJobWidget();
|
||||||
|
- m_jobOptions->setPrinter(printer);
|
||||||
|
+ m_jobOptions = new QCupsJobWidget(printer);
|
||||||
|
widget.tabs->addTab(m_jobOptions, tr("Job Options"));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
diff --git a/src/printsupport/widgets/qcupsjobwidget.cpp b/src/printsupport/widgets/qcupsjobwidget.cpp
|
||||||
|
index 00f2d64df2..8fb07c86b0 100644
|
||||||
|
--- a/src/printsupport/widgets/qcupsjobwidget.cpp
|
||||||
|
+++ b/src/printsupport/widgets/qcupsjobwidget.cpp
|
||||||
|
@@ -64,8 +64,9 @@ QT_BEGIN_NAMESPACE
|
||||||
|
\inmodule QtPrintSupport
|
||||||
|
*/
|
||||||
|
|
||||||
|
-QCupsJobWidget::QCupsJobWidget(QWidget *parent)
|
||||||
|
- : QWidget(parent)
|
||||||
|
+QCupsJobWidget::QCupsJobWidget(QPrinter *printer, QWidget *parent)
|
||||||
|
+ : QWidget(parent),
|
||||||
|
+ m_printer(printer)
|
||||||
|
{
|
||||||
|
m_ui.setupUi(this);
|
||||||
|
//set all the default values
|
||||||
|
@@ -80,11 +81,6 @@ QCupsJobWidget::~QCupsJobWidget()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
-void QCupsJobWidget::setPrinter(QPrinter *printer)
|
||||||
|
-{
|
||||||
|
- m_printer = printer;
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
void QCupsJobWidget::setupPrinter()
|
||||||
|
{
|
||||||
|
QCUPSSupport::setJobHold(m_printer, jobHold(), jobHoldTime());
|
||||||
|
diff --git a/src/printsupport/widgets/qcupsjobwidget_p.h b/src/printsupport/widgets/qcupsjobwidget_p.h
|
||||||
|
index 7d3c15938f..2aca6bc928 100644
|
||||||
|
--- a/src/printsupport/widgets/qcupsjobwidget_p.h
|
||||||
|
+++ b/src/printsupport/widgets/qcupsjobwidget_p.h
|
||||||
|
@@ -71,9 +71,8 @@ class QCupsJobWidget : public QWidget
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
- explicit QCupsJobWidget(QWidget *parent = 0);
|
||||||
|
+ explicit QCupsJobWidget(QPrinter *printer, QWidget *parent = nullptr);
|
||||||
|
~QCupsJobWidget();
|
||||||
|
- void setPrinter(QPrinter *printer);
|
||||||
|
void setupPrinter();
|
||||||
|
|
||||||
|
private Q_SLOTS:
|
||||||
|
--
|
||||||
|
2.15.1
|
||||||
|
|
91
0005-Remove-QPrintPropertiesDialog-selectPrinter.patch
Normal file
91
0005-Remove-QPrintPropertiesDialog-selectPrinter.patch
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
From 072dd59de771d0c942afd68260251be71bd59542 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Albert Astals Cid <albert.astals.cid@kdab.com>
|
||||||
|
Date: Mon, 4 Dec 2017 13:05:02 +0100
|
||||||
|
Subject: [PATCH 06/54] Remove QPrintPropertiesDialog::selectPrinter
|
||||||
|
|
||||||
|
It is only ever called after the constructor, so merge the code
|
||||||
|
|
||||||
|
Change-Id: I5c75a2cd367af401b41920f51754a64dc6c6eb40
|
||||||
|
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
|
||||||
|
---
|
||||||
|
src/printsupport/dialogs/qprintdialog_unix.cpp | 30 +++++++++++++-------------
|
||||||
|
1 file changed, 15 insertions(+), 15 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp
|
||||||
|
index 8c9997d572..c7f7488917 100644
|
||||||
|
--- a/src/printsupport/dialogs/qprintdialog_unix.cpp
|
||||||
|
+++ b/src/printsupport/dialogs/qprintdialog_unix.cpp
|
||||||
|
@@ -124,11 +124,10 @@ class QPrintPropertiesDialog : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
- QPrintPropertiesDialog(QPrinter *printer, QAbstractPrintDialog *parent = nullptr);
|
||||||
|
+ QPrintPropertiesDialog(QPrinter *printer, QPrinter::OutputFormat outputFormat,
|
||||||
|
+ const QString &printerName, QAbstractPrintDialog *parent = nullptr);
|
||||||
|
~QPrintPropertiesDialog();
|
||||||
|
|
||||||
|
- void selectPrinter(QPrinter::OutputFormat outputFormat, const QString &printerName);
|
||||||
|
-
|
||||||
|
void setupPrinter() const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
@@ -234,7 +233,8 @@ public:
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
-QPrintPropertiesDialog::QPrintPropertiesDialog(QPrinter *printer, QAbstractPrintDialog *parent)
|
||||||
|
+QPrintPropertiesDialog::QPrintPropertiesDialog(QPrinter *printer, QPrinter::OutputFormat outputFormat,
|
||||||
|
+ const QString &printerName, QAbstractPrintDialog *parent)
|
||||||
|
: QDialog(parent)
|
||||||
|
{
|
||||||
|
setWindowTitle(tr("Printer Properties"));
|
||||||
|
@@ -249,6 +249,7 @@ QPrintPropertiesDialog::QPrintPropertiesDialog(QPrinter *printer, QAbstractPrint
|
||||||
|
connect(m_buttons->button(QDialogButtonBox::Cancel), SIGNAL(clicked()), this, SLOT(reject()));
|
||||||
|
|
||||||
|
widget.pageSetup->setPrinter(printer);
|
||||||
|
+ widget.pageSetup->selectPrinter(outputFormat, printerName);
|
||||||
|
|
||||||
|
#if QT_CONFIG(cupsjobwidget)
|
||||||
|
m_jobOptions = new QCupsJobWidget(printer);
|
||||||
|
@@ -268,11 +269,6 @@ void QPrintPropertiesDialog::setupPrinter() const
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
-void QPrintPropertiesDialog::selectPrinter(QPrinter::OutputFormat outputFormat, const QString &printerName)
|
||||||
|
-{
|
||||||
|
- widget.pageSetup->selectPrinter(outputFormat, printerName);
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@@ -838,16 +834,20 @@ void QUnixPrintWidgetPrivate::setupPrinterProperties()
|
||||||
|
if (propertiesDialog)
|
||||||
|
delete propertiesDialog;
|
||||||
|
|
||||||
|
- propertiesDialog = new QPrintPropertiesDialog(q->printer(), q);
|
||||||
|
- propertiesDialog->setResult(QDialog::Rejected);
|
||||||
|
- propertiesDialogShown = false;
|
||||||
|
+ QPrinter::OutputFormat outputFormat;
|
||||||
|
+ QString printerName;
|
||||||
|
|
||||||
|
if (q->isOptionEnabled(QPrintDialog::PrintToFile)
|
||||||
|
&& (widget.printers->currentIndex() == widget.printers->count() - 1)) {// PDF
|
||||||
|
- propertiesDialog->selectPrinter(QPrinter::PdfFormat, QString());
|
||||||
|
+ outputFormat = QPrinter::PdfFormat;
|
||||||
|
+ } else {
|
||||||
|
+ outputFormat = QPrinter::NativeFormat;
|
||||||
|
+ printerName = widget.printers->currentText();
|
||||||
|
}
|
||||||
|
- else
|
||||||
|
- propertiesDialog->selectPrinter(QPrinter::NativeFormat, widget.printers->currentText());
|
||||||
|
+
|
||||||
|
+ propertiesDialog = new QPrintPropertiesDialog(q->printer(), outputFormat, printerName, q);
|
||||||
|
+ propertiesDialog->setResult(QDialog::Rejected);
|
||||||
|
+ propertiesDialogShown = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void QUnixPrintWidgetPrivate::_q_btnPropertiesClicked()
|
||||||
|
--
|
||||||
|
2.15.1
|
||||||
|
|
83
0006-Remove-QPageSetupWidget-selectPrinter.patch
Normal file
83
0006-Remove-QPageSetupWidget-selectPrinter.patch
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
From ceccdff4e9fc93819d819b8ed15d95822f980505 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Albert Astals Cid <albert.astals.cid@kdab.com>
|
||||||
|
Date: Mon, 4 Dec 2017 13:10:17 +0100
|
||||||
|
Subject: [PATCH 07/54] Remove QPageSetupWidget::selectPrinter
|
||||||
|
|
||||||
|
t's only ever called after setPrinter so merge the code
|
||||||
|
|
||||||
|
Change-Id: I4b5d593edbe62b64354e81c19112fa87b0555fdc
|
||||||
|
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
|
||||||
|
---
|
||||||
|
src/printsupport/dialogs/qpagesetupdialog_unix.cpp | 12 ++----------
|
||||||
|
src/printsupport/dialogs/qpagesetupdialog_unix_p.h | 3 +--
|
||||||
|
src/printsupport/dialogs/qprintdialog_unix.cpp | 3 +--
|
||||||
|
3 files changed, 4 insertions(+), 14 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/printsupport/dialogs/qpagesetupdialog_unix.cpp b/src/printsupport/dialogs/qpagesetupdialog_unix.cpp
|
||||||
|
index c321552a19..49c0184289 100644
|
||||||
|
--- a/src/printsupport/dialogs/qpagesetupdialog_unix.cpp
|
||||||
|
+++ b/src/printsupport/dialogs/qpagesetupdialog_unix.cpp
|
||||||
|
@@ -210,7 +210,7 @@ void QUnixPageSetupDialogPrivate::init()
|
||||||
|
Q_Q(QPageSetupDialog);
|
||||||
|
|
||||||
|
widget = new QPageSetupWidget(q);
|
||||||
|
- widget->setPrinter(printer);
|
||||||
|
+ widget->setPrinter(printer, printer->outputFormat(), printer->printerName());
|
||||||
|
|
||||||
|
QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok
|
||||||
|
| QDialogButtonBox::Cancel,
|
||||||
|
@@ -371,7 +371,7 @@ void QPageSetupWidget::initPageSizes()
|
||||||
|
|
||||||
|
// Set the dialog to use the given QPrinter
|
||||||
|
// Usually only called on first creation
|
||||||
|
-void QPageSetupWidget::setPrinter(QPrinter *printer)
|
||||||
|
+void QPageSetupWidget::setPrinter(QPrinter *printer, QPrinter::OutputFormat outputFormat, const QString &printerName)
|
||||||
|
{
|
||||||
|
m_printer = printer;
|
||||||
|
|
||||||
|
@@ -387,14 +387,6 @@ void QPageSetupWidget::setPrinter(QPrinter *printer)
|
||||||
|
m_units = m_pageLayout.units();
|
||||||
|
m_pagePreview->setPageLayout(m_pageLayout);
|
||||||
|
|
||||||
|
- // Then update the widget with the current printer details
|
||||||
|
- selectPrinter(m_printer->outputFormat(), m_printer->printerName());
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-// The printer selected in the QPrintDialog has been changed, update the widget to reflect this
|
||||||
|
-// Note the QPrinter is not updated at this time in case the user presses the Cancel button in QPrintDialog
|
||||||
|
-void QPageSetupWidget::selectPrinter(QPrinter::OutputFormat outputFormat, const QString &printerName)
|
||||||
|
-{
|
||||||
|
m_outputFormat = outputFormat;
|
||||||
|
m_printerName = printerName;
|
||||||
|
initPageSizes();
|
||||||
|
diff --git a/src/printsupport/dialogs/qpagesetupdialog_unix_p.h b/src/printsupport/dialogs/qpagesetupdialog_unix_p.h
|
||||||
|
index 658f103bea..c57b01c2d6 100644
|
||||||
|
--- a/src/printsupport/dialogs/qpagesetupdialog_unix_p.h
|
||||||
|
+++ b/src/printsupport/dialogs/qpagesetupdialog_unix_p.h
|
||||||
|
@@ -72,8 +72,7 @@ public:
|
||||||
|
explicit QPageSetupWidget(QWidget *parent = 0);
|
||||||
|
explicit QPageSetupWidget(QPrinter *printer, QWidget *parent = 0);
|
||||||
|
|
||||||
|
- void setPrinter(QPrinter *printer);
|
||||||
|
- void selectPrinter(QPrinter::OutputFormat outputFormat, const QString &printerName);
|
||||||
|
+ void setPrinter(QPrinter *printer, QPrinter::OutputFormat outputFormat, const QString &printerName);
|
||||||
|
void setupPrinter() const;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp
|
||||||
|
index c7f7488917..f87630f1a0 100644
|
||||||
|
--- a/src/printsupport/dialogs/qprintdialog_unix.cpp
|
||||||
|
+++ b/src/printsupport/dialogs/qprintdialog_unix.cpp
|
||||||
|
@@ -248,8 +248,7 @@ QPrintPropertiesDialog::QPrintPropertiesDialog(QPrinter *printer, QPrinter::Outp
|
||||||
|
connect(m_buttons->button(QDialogButtonBox::Ok), SIGNAL(clicked()), this, SLOT(accept()));
|
||||||
|
connect(m_buttons->button(QDialogButtonBox::Cancel), SIGNAL(clicked()), this, SLOT(reject()));
|
||||||
|
|
||||||
|
- widget.pageSetup->setPrinter(printer);
|
||||||
|
- widget.pageSetup->selectPrinter(outputFormat, printerName);
|
||||||
|
+ widget.pageSetup->setPrinter(printer, outputFormat, printerName);
|
||||||
|
|
||||||
|
#if QT_CONFIG(cupsjobwidget)
|
||||||
|
m_jobOptions = new QCupsJobWidget(printer);
|
||||||
|
--
|
||||||
|
2.15.1
|
||||||
|
|
113
0007-Introduce-QPrintDevice-property-setProperty.patch
Normal file
113
0007-Introduce-QPrintDevice-property-setProperty.patch
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
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
|
||||||
|
|
@ -0,0 +1,97 @@
|
|||||||
|
From e79efe94e3e77ee035ff7d046158a577759f8c7c Mon Sep 17 00:00:00 2001
|
||||||
|
From: Albert Astals Cid <albert.astals.cid@kdab.com>
|
||||||
|
Date: Mon, 4 Dec 2017 14:05:55 +0100
|
||||||
|
Subject: [PATCH 38/54] Allow access to ppd file and ppdMarkOption via
|
||||||
|
QPpdPrintDevice::property/setProperty
|
||||||
|
|
||||||
|
Change-Id: I47b49b52121950fa8e3ea7a056974d9f3033490f
|
||||||
|
Reviewed-by: Liang Qi <liang.qi@qt.io>
|
||||||
|
---
|
||||||
|
src/plugins/printsupport/cups/qppdprintdevice.cpp | 21 +++++++++++++++++++++
|
||||||
|
src/plugins/printsupport/cups/qppdprintdevice.h | 3 +++
|
||||||
|
src/printsupport/kernel/qcups_p.h | 3 +++
|
||||||
|
src/printsupport/kernel/qprint_p.h | 1 +
|
||||||
|
4 files changed, 28 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/src/plugins/printsupport/cups/qppdprintdevice.cpp b/src/plugins/printsupport/cups/qppdprintdevice.cpp
|
||||||
|
index 9efa83d409..ad829df23d 100644
|
||||||
|
--- a/src/plugins/printsupport/cups/qppdprintdevice.cpp
|
||||||
|
+++ b/src/plugins/printsupport/cups/qppdprintdevice.cpp
|
||||||
|
@@ -42,6 +42,8 @@
|
||||||
|
#include <QtCore/QMimeDatabase>
|
||||||
|
#include <qdebug.h>
|
||||||
|
|
||||||
|
+#include "private/qcups_p.h" // Only needed for PDPK_*
|
||||||
|
+
|
||||||
|
#ifndef QT_LINUXBASE // LSB merges everything into cups.h
|
||||||
|
#include <cups/language.h>
|
||||||
|
#endif
|
||||||
|
@@ -421,6 +423,25 @@ QPrint::ColorMode QPpdPrintDevice::defaultColorMode() const
|
||||||
|
return QPrint::GrayScale;
|
||||||
|
}
|
||||||
|
|
||||||
|
+QVariant QPpdPrintDevice::property(QPrintDevice::PrintDevicePropertyKey key) const
|
||||||
|
+{
|
||||||
|
+ if (key == PDPK_PpdFile)
|
||||||
|
+ return QVariant::fromValue<ppd_file_t *>(m_ppd);
|
||||||
|
+
|
||||||
|
+ return QVariant();
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+bool QPpdPrintDevice::setProperty(QPrintDevice::PrintDevicePropertyKey key, const QVariant &value)
|
||||||
|
+{
|
||||||
|
+ if (key == PDPK_PpdOption) {
|
||||||
|
+ const QStringList values = value.toStringList();
|
||||||
|
+ if (values.count() == 2)
|
||||||
|
+ return ppdMarkOption(m_ppd, values[0].toLatin1(), values[1].toLatin1()) == 0;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return false;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
#ifndef QT_NO_MIMETYPE
|
||||||
|
void QPpdPrintDevice::loadMimeTypes() const
|
||||||
|
{
|
||||||
|
diff --git a/src/plugins/printsupport/cups/qppdprintdevice.h b/src/plugins/printsupport/cups/qppdprintdevice.h
|
||||||
|
index 3cd7518b14..2e4dd3ab3b 100644
|
||||||
|
--- a/src/plugins/printsupport/cups/qppdprintdevice.h
|
||||||
|
+++ b/src/plugins/printsupport/cups/qppdprintdevice.h
|
||||||
|
@@ -89,6 +89,9 @@ public:
|
||||||
|
|
||||||
|
QPrint::ColorMode defaultColorMode() const Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
|
+ QVariant property(QPrintDevice::PrintDevicePropertyKey key) const Q_DECL_OVERRIDE;
|
||||||
|
+ bool setProperty(QPrintDevice::PrintDevicePropertyKey key, const QVariant &value) Q_DECL_OVERRIDE;
|
||||||
|
+
|
||||||
|
protected:
|
||||||
|
void loadPageSizes() const Q_DECL_OVERRIDE;
|
||||||
|
void loadResolutions() const Q_DECL_OVERRIDE;
|
||||||
|
diff --git a/src/printsupport/kernel/qcups_p.h b/src/printsupport/kernel/qcups_p.h
|
||||||
|
index 780115e350..b67390c4ed 100644
|
||||||
|
--- a/src/printsupport/kernel/qcups_p.h
|
||||||
|
+++ b/src/printsupport/kernel/qcups_p.h
|
||||||
|
@@ -67,6 +67,9 @@ QT_BEGIN_NAMESPACE
|
||||||
|
// removed from the dialogs.
|
||||||
|
#define PPK_CupsOptions QPrintEngine::PrintEnginePropertyKey(0xfe00)
|
||||||
|
|
||||||
|
+#define PDPK_PpdFile QPrintDevice::PrintDevicePropertyKey(QPrintDevice::PDPK_CustomBase)
|
||||||
|
+#define PDPK_PpdOption QPrintDevice::PrintDevicePropertyKey(QPrintDevice::PDPK_CustomBase + 1)
|
||||||
|
+
|
||||||
|
class Q_PRINTSUPPORT_EXPORT QCUPSSupport
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
diff --git a/src/printsupport/kernel/qprint_p.h b/src/printsupport/kernel/qprint_p.h
|
||||||
|
index 280c2d7608..4956775461 100644
|
||||||
|
--- a/src/printsupport/kernel/qprint_p.h
|
||||||
|
+++ b/src/printsupport/kernel/qprint_p.h
|
||||||
|
@@ -59,6 +59,7 @@
|
||||||
|
|
||||||
|
#if (defined Q_OS_MACOS) || (defined Q_OS_UNIX && QT_CONFIG(cups))
|
||||||
|
#include <cups/ppd.h> // Use for type defs only, don't want to actually link in main module
|
||||||
|
+Q_DECLARE_METATYPE(ppd_file_t *)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
--
|
||||||
|
2.15.1
|
||||||
|
|
240
0009-QPlatformPrintDevice-use-QVector-not-QList-in-the-AP.patch
Normal file
240
0009-QPlatformPrintDevice-use-QVector-not-QList-in-the-AP.patch
Normal file
@ -0,0 +1,240 @@
|
|||||||
|
From 5cb54cb5ebae99fab121061e25e26eec3056203a Mon Sep 17 00:00:00 2001
|
||||||
|
From: Marc Mutz <marc.mutz@kdab.com>
|
||||||
|
Date: Tue, 12 Dec 2017 12:44:02 +0100
|
||||||
|
Subject: [PATCH 44/54] QPlatformPrintDevice: use QVector, not QList in the API
|
||||||
|
|
||||||
|
QPlaformPrintDevice uses QVector to store, but QList in the getters to
|
||||||
|
retrieve these data. Port API from QList to QVector to avoid
|
||||||
|
conversion between the two containers on every access.
|
||||||
|
|
||||||
|
Saves almost 4KiB in text size (another 0.9% of QtPrintSupport).
|
||||||
|
|
||||||
|
Change-Id: If33df141b87753803c45d9f4dae501a68abe49af
|
||||||
|
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
||||||
|
---
|
||||||
|
src/printsupport/kernel/qplatformprintdevice.cpp | 16 ++++++++--------
|
||||||
|
src/printsupport/kernel/qplatformprintdevice.h | 8 ++++----
|
||||||
|
src/printsupport/kernel/qprintdevice.cpp | 16 ++++++++--------
|
||||||
|
src/printsupport/kernel/qprintdevice_p.h | 8 ++++----
|
||||||
|
src/printsupport/kernel/qprintengine_win.cpp | 8 ++++----
|
||||||
|
src/printsupport/kernel/qprinterinfo.cpp | 2 +-
|
||||||
|
6 files changed, 29 insertions(+), 29 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/printsupport/kernel/qplatformprintdevice.cpp b/src/printsupport/kernel/qplatformprintdevice.cpp
|
||||||
|
index 82bddedb1b..2f76156a91 100644
|
||||||
|
--- a/src/printsupport/kernel/qplatformprintdevice.cpp
|
||||||
|
+++ b/src/printsupport/kernel/qplatformprintdevice.cpp
|
||||||
|
@@ -313,11 +313,11 @@ QPrint::InputSlot QPlatformPrintDevice::defaultInputSlot() const
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
|
||||||
|
-QList<QPrint::InputSlot> QPlatformPrintDevice::supportedInputSlots() const
|
||||||
|
+QVector<QPrint::InputSlot> QPlatformPrintDevice::supportedInputSlots() const
|
||||||
|
{
|
||||||
|
if (!m_haveInputSlots)
|
||||||
|
loadInputSlots();
|
||||||
|
- return m_inputSlots.toList();
|
||||||
|
+ return m_inputSlots;
|
||||||
|
}
|
||||||
|
|
||||||
|
void QPlatformPrintDevice::loadOutputBins() const
|
||||||
|
@@ -337,11 +337,11 @@ QPrint::OutputBin QPlatformPrintDevice::defaultOutputBin() const
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
|
-QList<QPrint::OutputBin> QPlatformPrintDevice::supportedOutputBins() const
|
||||||
|
+QVector<QPrint::OutputBin> QPlatformPrintDevice::supportedOutputBins() const
|
||||||
|
{
|
||||||
|
if (!m_haveOutputBins)
|
||||||
|
loadOutputBins();
|
||||||
|
- return m_outputBins.toList();
|
||||||
|
+ return m_outputBins;
|
||||||
|
}
|
||||||
|
|
||||||
|
void QPlatformPrintDevice::loadDuplexModes() const
|
||||||
|
@@ -353,11 +353,11 @@ QPrint::DuplexMode QPlatformPrintDevice::defaultDuplexMode() const
|
||||||
|
return QPrint::DuplexNone;
|
||||||
|
}
|
||||||
|
|
||||||
|
-QList<QPrint::DuplexMode> QPlatformPrintDevice::supportedDuplexModes() const
|
||||||
|
+QVector<QPrint::DuplexMode> QPlatformPrintDevice::supportedDuplexModes() const
|
||||||
|
{
|
||||||
|
if (!m_haveDuplexModes)
|
||||||
|
loadDuplexModes();
|
||||||
|
- return m_duplexModes.toList();
|
||||||
|
+ return m_duplexModes;
|
||||||
|
}
|
||||||
|
|
||||||
|
void QPlatformPrintDevice::loadColorModes() const
|
||||||
|
@@ -369,11 +369,11 @@ QPrint::ColorMode QPlatformPrintDevice::defaultColorMode() const
|
||||||
|
return QPrint::GrayScale;
|
||||||
|
}
|
||||||
|
|
||||||
|
-QList<QPrint::ColorMode> QPlatformPrintDevice::supportedColorModes() const
|
||||||
|
+QVector<QPrint::ColorMode> QPlatformPrintDevice::supportedColorModes() const
|
||||||
|
{
|
||||||
|
if (!m_haveColorModes)
|
||||||
|
loadColorModes();
|
||||||
|
- return m_colorModes.toList();
|
||||||
|
+ return m_colorModes;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifndef QT_NO_MIMETYPE
|
||||||
|
diff --git a/src/printsupport/kernel/qplatformprintdevice.h b/src/printsupport/kernel/qplatformprintdevice.h
|
||||||
|
index 1cac009660..8af76464b5 100644
|
||||||
|
--- a/src/printsupport/kernel/qplatformprintdevice.h
|
||||||
|
+++ b/src/printsupport/kernel/qplatformprintdevice.h
|
||||||
|
@@ -110,16 +110,16 @@ public:
|
||||||
|
virtual QList<int> supportedResolutions() const;
|
||||||
|
|
||||||
|
virtual QPrint::InputSlot defaultInputSlot() const;
|
||||||
|
- virtual QList<QPrint::InputSlot> supportedInputSlots() const;
|
||||||
|
+ virtual QVector<QPrint::InputSlot> supportedInputSlots() const;
|
||||||
|
|
||||||
|
virtual QPrint::OutputBin defaultOutputBin() const;
|
||||||
|
- virtual QList<QPrint::OutputBin> supportedOutputBins() const;
|
||||||
|
+ virtual QVector<QPrint::OutputBin> supportedOutputBins() const;
|
||||||
|
|
||||||
|
virtual QPrint::DuplexMode defaultDuplexMode() const;
|
||||||
|
- virtual QList<QPrint::DuplexMode> supportedDuplexModes() const;
|
||||||
|
+ virtual QVector<QPrint::DuplexMode> supportedDuplexModes() const;
|
||||||
|
|
||||||
|
virtual QPrint::ColorMode defaultColorMode() const;
|
||||||
|
- virtual QList<QPrint::ColorMode> supportedColorModes() const;
|
||||||
|
+ virtual QVector<QPrint::ColorMode> supportedColorModes() const;
|
||||||
|
|
||||||
|
virtual QVariant property(QPrintDevice::PrintDevicePropertyKey key) const;
|
||||||
|
virtual bool setProperty(QPrintDevice::PrintDevicePropertyKey key, const QVariant &value);
|
||||||
|
diff --git a/src/printsupport/kernel/qprintdevice.cpp b/src/printsupport/kernel/qprintdevice.cpp
|
||||||
|
index 7096f5a2f6..2bc6906364 100644
|
||||||
|
--- a/src/printsupport/kernel/qprintdevice.cpp
|
||||||
|
+++ b/src/printsupport/kernel/qprintdevice.cpp
|
||||||
|
@@ -210,9 +210,9 @@ QPrint::InputSlot QPrintDevice::defaultInputSlot() const
|
||||||
|
return isValid() ? d->defaultInputSlot() : QPrint::InputSlot();
|
||||||
|
}
|
||||||
|
|
||||||
|
-QList<QPrint::InputSlot> QPrintDevice::supportedInputSlots() const
|
||||||
|
+QVector<QPrint::InputSlot> QPrintDevice::supportedInputSlots() const
|
||||||
|
{
|
||||||
|
- return isValid() ? d->supportedInputSlots() : QList<QPrint::InputSlot>();
|
||||||
|
+ return isValid() ? d->supportedInputSlots() : QVector<QPrint::InputSlot>{};
|
||||||
|
}
|
||||||
|
|
||||||
|
QPrint::OutputBin QPrintDevice::defaultOutputBin() const
|
||||||
|
@@ -220,9 +220,9 @@ QPrint::OutputBin QPrintDevice::defaultOutputBin() const
|
||||||
|
return isValid() ? d->defaultOutputBin() : QPrint::OutputBin();
|
||||||
|
}
|
||||||
|
|
||||||
|
-QList<QPrint::OutputBin> QPrintDevice::supportedOutputBins() const
|
||||||
|
+QVector<QPrint::OutputBin> QPrintDevice::supportedOutputBins() const
|
||||||
|
{
|
||||||
|
- return isValid() ? d->supportedOutputBins() : QList<QPrint::OutputBin>();
|
||||||
|
+ return isValid() ? d->supportedOutputBins() : QVector<QPrint::OutputBin>{};
|
||||||
|
}
|
||||||
|
|
||||||
|
QPrint::DuplexMode QPrintDevice::defaultDuplexMode() const
|
||||||
|
@@ -230,9 +230,9 @@ QPrint::DuplexMode QPrintDevice::defaultDuplexMode() const
|
||||||
|
return isValid() ? d->defaultDuplexMode() : QPrint::DuplexNone;
|
||||||
|
}
|
||||||
|
|
||||||
|
-QList<QPrint::DuplexMode> QPrintDevice::supportedDuplexModes() const
|
||||||
|
+QVector<QPrint::DuplexMode> QPrintDevice::supportedDuplexModes() const
|
||||||
|
{
|
||||||
|
- return isValid() ? d->supportedDuplexModes() : QList<QPrint::DuplexMode>();
|
||||||
|
+ return isValid() ? d->supportedDuplexModes() : QVector<QPrint::DuplexMode>{};
|
||||||
|
}
|
||||||
|
|
||||||
|
QPrint::ColorMode QPrintDevice::defaultColorMode() const
|
||||||
|
@@ -240,9 +240,9 @@ QPrint::ColorMode QPrintDevice::defaultColorMode() const
|
||||||
|
return isValid() ? d->defaultColorMode() : QPrint::GrayScale;
|
||||||
|
}
|
||||||
|
|
||||||
|
-QList<QPrint::ColorMode> QPrintDevice::supportedColorModes() const
|
||||||
|
+QVector<QPrint::ColorMode> QPrintDevice::supportedColorModes() const
|
||||||
|
{
|
||||||
|
- return isValid() ? d->supportedColorModes() : QList<QPrint::ColorMode>();
|
||||||
|
+ return isValid() ? d->supportedColorModes() : QVector<QPrint::ColorMode>{};
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant QPrintDevice::property(PrintDevicePropertyKey key) const
|
||||||
|
diff --git a/src/printsupport/kernel/qprintdevice_p.h b/src/printsupport/kernel/qprintdevice_p.h
|
||||||
|
index 1a26d3afcf..3dff2e54fe 100644
|
||||||
|
--- a/src/printsupport/kernel/qprintdevice_p.h
|
||||||
|
+++ b/src/printsupport/kernel/qprintdevice_p.h
|
||||||
|
@@ -120,16 +120,16 @@ public:
|
||||||
|
QList<int> supportedResolutions() const;
|
||||||
|
|
||||||
|
QPrint::InputSlot defaultInputSlot() const;
|
||||||
|
- QList<QPrint::InputSlot> supportedInputSlots() const;
|
||||||
|
+ QVector<QPrint::InputSlot> supportedInputSlots() const;
|
||||||
|
|
||||||
|
QPrint::OutputBin defaultOutputBin() const;
|
||||||
|
- QList<QPrint::OutputBin> supportedOutputBins() const;
|
||||||
|
+ QVector<QPrint::OutputBin> supportedOutputBins() const;
|
||||||
|
|
||||||
|
QPrint::DuplexMode defaultDuplexMode() const;
|
||||||
|
- QList<QPrint::DuplexMode> supportedDuplexModes() const;
|
||||||
|
+ QVector<QPrint::DuplexMode> supportedDuplexModes() const;
|
||||||
|
|
||||||
|
QPrint::ColorMode defaultColorMode() const;
|
||||||
|
- QList<QPrint::ColorMode> supportedColorModes() const;
|
||||||
|
+ QVector<QPrint::ColorMode> supportedColorModes() const;
|
||||||
|
|
||||||
|
enum PrintDevicePropertyKey {
|
||||||
|
PDPK_CustomBase = 0xff00
|
||||||
|
diff --git a/src/printsupport/kernel/qprintengine_win.cpp b/src/printsupport/kernel/qprintengine_win.cpp
|
||||||
|
index e399118cc9..ba234b3aae 100644
|
||||||
|
--- a/src/printsupport/kernel/qprintengine_win.cpp
|
||||||
|
+++ b/src/printsupport/kernel/qprintengine_win.cpp
|
||||||
|
@@ -1024,7 +1024,7 @@ bool QWin32PrintEnginePrivate::resetDC()
|
||||||
|
return hdc != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
-static int indexOfId(const QList<QPrint::InputSlot> &inputSlots, QPrint::InputSlotId id)
|
||||||
|
+static int indexOfId(const QVector<QPrint::InputSlot> &inputSlots, QPrint::InputSlotId id)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < inputSlots.size(); ++i) {
|
||||||
|
if (inputSlots.at(i).id == id)
|
||||||
|
@@ -1033,7 +1033,7 @@ static int indexOfId(const QList<QPrint::InputSlot> &inputSlots, QPrint::InputSl
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
-static int indexOfWindowsId(const QList<QPrint::InputSlot> &inputSlots, int windowsId)
|
||||||
|
+static int indexOfWindowsId(const QVector<QPrint::InputSlot> &inputSlots, int windowsId)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < inputSlots.size(); ++i) {
|
||||||
|
if (inputSlots.at(i).windowsId == windowsId)
|
||||||
|
@@ -1210,7 +1210,7 @@ void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant &
|
||||||
|
case PPK_PaperSource: {
|
||||||
|
if (!d->devMode)
|
||||||
|
break;
|
||||||
|
- const QList<QPrint::InputSlot> inputSlots = d->m_printDevice.supportedInputSlots();
|
||||||
|
+ const auto inputSlots = d->m_printDevice.supportedInputSlots();
|
||||||
|
const int paperSource = value.toInt();
|
||||||
|
const int index = paperSource >= DMBIN_USER ?
|
||||||
|
indexOfWindowsId(inputSlots, paperSource) : indexOfId(inputSlots, QPrint::InputSlotId(paperSource));
|
||||||
|
@@ -1465,7 +1465,7 @@ QVariant QWin32PrintEngine::property(PrintEnginePropertyKey key) const
|
||||||
|
if (d->devMode->dmDefaultSource >= DMBIN_USER) {
|
||||||
|
value = int(d->devMode->dmDefaultSource);
|
||||||
|
} else {
|
||||||
|
- const QList<QPrint::InputSlot> inputSlots = d->m_printDevice.supportedInputSlots();
|
||||||
|
+ const auto inputSlots = d->m_printDevice.supportedInputSlots();
|
||||||
|
const int index = indexOfWindowsId(inputSlots, d->devMode->dmDefaultSource);
|
||||||
|
value = index >= 0 ? inputSlots.at(index).id : QPrint::Auto;
|
||||||
|
}
|
||||||
|
diff --git a/src/printsupport/kernel/qprinterinfo.cpp b/src/printsupport/kernel/qprinterinfo.cpp
|
||||||
|
index d271e069ad..49a0c9ece4 100644
|
||||||
|
--- a/src/printsupport/kernel/qprinterinfo.cpp
|
||||||
|
+++ b/src/printsupport/kernel/qprinterinfo.cpp
|
||||||
|
@@ -380,7 +380,7 @@ QList<QPrinter::DuplexMode> QPrinterInfo::supportedDuplexModes() const
|
||||||
|
{
|
||||||
|
Q_D(const QPrinterInfo);
|
||||||
|
QList<QPrinter::DuplexMode> list;
|
||||||
|
- const QList<QPrint::DuplexMode> supportedDuplexModes = d->m_printDevice.supportedDuplexModes();
|
||||||
|
+ const auto supportedDuplexModes = d->m_printDevice.supportedDuplexModes();
|
||||||
|
list.reserve(supportedDuplexModes.size());
|
||||||
|
for (QPrint::DuplexMode mode : supportedDuplexModes)
|
||||||
|
list << QPrinter::DuplexMode(mode);
|
||||||
|
--
|
||||||
|
2.15.1
|
||||||
|
|
527
0010-Reintroduce-the-Advanced-tab-in-the-QPrintProperties.patch
Normal file
527
0010-Reintroduce-the-Advanced-tab-in-the-QPrintProperties.patch
Normal file
@ -0,0 +1,527 @@
|
|||||||
|
From b4330bc391bbb08898f192ea3469b73aed09134c Mon Sep 17 00:00:00 2001
|
||||||
|
From: Albert Astals Cid <albert.astals.cid@kdab.com>
|
||||||
|
Date: Tue, 5 Dec 2017 09:40:59 +0100
|
||||||
|
Subject: [PATCH 50/54] Reintroduce the Advanced tab in the
|
||||||
|
QPrintPropertiesDialog
|
||||||
|
|
||||||
|
This is mostly a revert of 69de6177615de3c4c31dea529172389e92f490b0 adapted to the new code.
|
||||||
|
|
||||||
|
The commit that removed this code said:
|
||||||
|
a) there's duplicate settings in the advanced tabs and in the rest of the ui: this easily
|
||||||
|
solved with a blacklist
|
||||||
|
b) you can set these options in the system settings: probably true, but it is very cumbersome
|
||||||
|
to go to the printer settings every time i print to select from which tray the
|
||||||
|
paper should be used
|
||||||
|
|
||||||
|
Task Number: QTBUG-54464
|
||||||
|
|
||||||
|
Change-Id: I7b1cacf51006dadb10aa6e00fe6dd2ff748fe576
|
||||||
|
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
|
||||||
|
---
|
||||||
|
src/printsupport/dialogs/qprintdialog_unix.cpp | 401 ++++++++++++++++++++-
|
||||||
|
src/printsupport/dialogs/qprintpropertieswidget.ui | 14 +
|
||||||
|
2 files changed, 409 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp
|
||||||
|
index f87630f1a0..d5ad90e85e 100644
|
||||||
|
--- a/src/printsupport/dialogs/qprintdialog_unix.cpp
|
||||||
|
+++ b/src/printsupport/dialogs/qprintdialog_unix.cpp
|
||||||
|
@@ -108,6 +108,11 @@ Print dialog class declarations
|
||||||
|
allow editing of Page and Advanced tabs.
|
||||||
|
|
||||||
|
Layout in qprintpropertieswidget.ui
|
||||||
|
+
|
||||||
|
+ QPPDOptionsModel: Holds the PPD Options for the printer.
|
||||||
|
+
|
||||||
|
+ QPPDOptionsEditor: Edits the PPD Options for the printer.
|
||||||
|
+
|
||||||
|
*/
|
||||||
|
|
||||||
|
static void initResources()
|
||||||
|
@@ -124,19 +129,29 @@ class QPrintPropertiesDialog : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
- QPrintPropertiesDialog(QPrinter *printer, QPrinter::OutputFormat outputFormat,
|
||||||
|
- const QString &printerName, QAbstractPrintDialog *parent = nullptr);
|
||||||
|
+ QPrintPropertiesDialog(QPrinter *printer, QPrintDevice *currentPrintDevice,
|
||||||
|
+ QPrinter::OutputFormat outputFormat, const QString &printerName,
|
||||||
|
+ QAbstractPrintDialog *parent);
|
||||||
|
~QPrintPropertiesDialog();
|
||||||
|
|
||||||
|
void setupPrinter() const;
|
||||||
|
|
||||||
|
+ void showEvent(QShowEvent *event) override;
|
||||||
|
+
|
||||||
|
private:
|
||||||
|
friend class QUnixPrintWidgetPrivate;
|
||||||
|
+ QPrinter *m_printer;
|
||||||
|
Ui::QPrintPropertiesWidget widget;
|
||||||
|
QDialogButtonBox *m_buttons;
|
||||||
|
#if QT_CONFIG(cupsjobwidget)
|
||||||
|
QCupsJobWidget *m_jobOptions;
|
||||||
|
#endif
|
||||||
|
+
|
||||||
|
+#if QT_CONFIG(cups)
|
||||||
|
+ void setCupsOptionsFromItems(QOptionTreeItem *parent) const;
|
||||||
|
+
|
||||||
|
+ QPPDOptionsModel *m_cupsOptionsModel;
|
||||||
|
+#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
class QUnixPrintWidgetPrivate;
|
||||||
|
@@ -220,6 +235,70 @@ public:
|
||||||
|
QPrinter::OutputFormat printerOutputFormat;
|
||||||
|
};
|
||||||
|
|
||||||
|
+#if QT_CONFIG(cups)
|
||||||
|
+class QOptionTreeItem
|
||||||
|
+{
|
||||||
|
+public:
|
||||||
|
+ enum ItemType { Root, Group, Option, Choice };
|
||||||
|
+
|
||||||
|
+ QOptionTreeItem(ItemType t, int i, const void *p, const char *desc, QOptionTreeItem *pi)
|
||||||
|
+ : type(t),
|
||||||
|
+ index(i),
|
||||||
|
+ ptr(p),
|
||||||
|
+ description(desc),
|
||||||
|
+ selected(-1),
|
||||||
|
+ selDescription(nullptr),
|
||||||
|
+ parentItem(pi) {}
|
||||||
|
+
|
||||||
|
+ ~QOptionTreeItem() {
|
||||||
|
+ qDeleteAll(childItems);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ ItemType type;
|
||||||
|
+ int index;
|
||||||
|
+ const void *ptr;
|
||||||
|
+ const char *description;
|
||||||
|
+ int selected;
|
||||||
|
+ const char *selDescription;
|
||||||
|
+ QOptionTreeItem *parentItem;
|
||||||
|
+ QList<QOptionTreeItem*> childItems;
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+class QPPDOptionsModel : public QAbstractItemModel
|
||||||
|
+{
|
||||||
|
+ Q_OBJECT
|
||||||
|
+
|
||||||
|
+public:
|
||||||
|
+ explicit QPPDOptionsModel(QPrintDevice *currentPrintDevice, QObject *parent);
|
||||||
|
+
|
||||||
|
+ int columnCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||||
|
+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||||
|
+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||||
|
+ QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
|
||||||
|
+ QModelIndex parent(const QModelIndex &index) const override;
|
||||||
|
+ Qt::ItemFlags flags(const QModelIndex &index) const override;
|
||||||
|
+ QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const override;
|
||||||
|
+
|
||||||
|
+ QPrintDevice *m_currentPrintDevice;
|
||||||
|
+ QTextCodec *cupsCodec;
|
||||||
|
+ QOptionTreeItem *rootItem;
|
||||||
|
+ void parseGroups(QOptionTreeItem *parent);
|
||||||
|
+ void parseOptions(QOptionTreeItem *parent);
|
||||||
|
+ void parseChoices(QOptionTreeItem *parent);
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+class QPPDOptionsEditor : public QStyledItemDelegate
|
||||||
|
+{
|
||||||
|
+ Q_OBJECT
|
||||||
|
+public:
|
||||||
|
+ explicit QPPDOptionsEditor(QObject *parent) : QStyledItemDelegate(parent) {}
|
||||||
|
+
|
||||||
|
+ QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
|
||||||
|
+ void setEditorData(QWidget *editor, const QModelIndex &index) const override;
|
||||||
|
+ void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override;
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@@ -233,9 +312,11 @@ public:
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
-QPrintPropertiesDialog::QPrintPropertiesDialog(QPrinter *printer, QPrinter::OutputFormat outputFormat,
|
||||||
|
- const QString &printerName, QAbstractPrintDialog *parent)
|
||||||
|
+QPrintPropertiesDialog::QPrintPropertiesDialog(QPrinter *printer, QPrintDevice *currentPrintDevice,
|
||||||
|
+ QPrinter::OutputFormat outputFormat, const QString &printerName,
|
||||||
|
+ QAbstractPrintDialog *parent)
|
||||||
|
: QDialog(parent)
|
||||||
|
+ , m_printer(printer)
|
||||||
|
{
|
||||||
|
setWindowTitle(tr("Printer Properties"));
|
||||||
|
QVBoxLayout *lay = new QVBoxLayout(this);
|
||||||
|
@@ -252,7 +333,29 @@ QPrintPropertiesDialog::QPrintPropertiesDialog(QPrinter *printer, QPrinter::Outp
|
||||||
|
|
||||||
|
#if QT_CONFIG(cupsjobwidget)
|
||||||
|
m_jobOptions = new QCupsJobWidget(printer);
|
||||||
|
- widget.tabs->addTab(m_jobOptions, tr("Job Options"));
|
||||||
|
+ widget.tabs->insertTab(1, m_jobOptions, tr("Job Options"));
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
+ const int advancedTabIndex = widget.tabs->indexOf(widget.cupsPropertiesPage);
|
||||||
|
+#if QT_CONFIG(cups)
|
||||||
|
+ m_cupsOptionsModel = new QPPDOptionsModel(currentPrintDevice, this);
|
||||||
|
+
|
||||||
|
+ widget.treeView->setItemDelegate(new QPPDOptionsEditor(this));
|
||||||
|
+
|
||||||
|
+ if (m_cupsOptionsModel->rowCount() > 0) {
|
||||||
|
+ widget.treeView->setModel(m_cupsOptionsModel);
|
||||||
|
+
|
||||||
|
+ for (int i = 0; i < m_cupsOptionsModel->rowCount(); ++i)
|
||||||
|
+ widget.treeView->expand(m_cupsOptionsModel->index(i, 0));
|
||||||
|
+
|
||||||
|
+ widget.tabs->setTabEnabled(advancedTabIndex, true);
|
||||||
|
+ } else {
|
||||||
|
+ widget.treeView->setModel(nullptr);
|
||||||
|
+ widget.tabs->setTabEnabled(advancedTabIndex, false);
|
||||||
|
+ }
|
||||||
|
+#else
|
||||||
|
+ Q_UNUSED(currentPrintDevice)
|
||||||
|
+ widget.tabs->setTabEnabled(advancedTabIndex, false);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -266,8 +369,36 @@ void QPrintPropertiesDialog::setupPrinter() const
|
||||||
|
#if QT_CONFIG(cupsjobwidget)
|
||||||
|
m_jobOptions->setupPrinter();
|
||||||
|
#endif
|
||||||
|
+
|
||||||
|
+#if QT_CONFIG(cups)
|
||||||
|
+ setCupsOptionsFromItems(m_cupsOptionsModel->rootItem);
|
||||||
|
+#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
+void QPrintPropertiesDialog::showEvent(QShowEvent *event)
|
||||||
|
+{
|
||||||
|
+ widget.treeView->resizeColumnToContents(0);
|
||||||
|
+ QDialog::showEvent(event);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+#if QT_CONFIG(cups)
|
||||||
|
+void QPrintPropertiesDialog::setCupsOptionsFromItems(QOptionTreeItem *parent) const
|
||||||
|
+{
|
||||||
|
+ for (QOptionTreeItem *itm : qAsConst(parent->childItems)) {
|
||||||
|
+ if (itm->type == QOptionTreeItem::Option) {
|
||||||
|
+ const ppd_option_t *opt = static_cast<const ppd_option_t*>(itm->ptr);
|
||||||
|
+ if (qstrcmp(opt->defchoice, opt->choices[itm->selected].choice) != 0) {
|
||||||
|
+ QStringList cupsOptions = QCUPSSupport::cupsOptionsList(m_printer);
|
||||||
|
+ QCUPSSupport::setCupsOption(cupsOptions, QString::fromLatin1(opt->keyword), QString::fromLatin1(opt->choices[itm->selected].choice));
|
||||||
|
+ QCUPSSupport::setCupsOptions(m_printer, cupsOptions);
|
||||||
|
+ }
|
||||||
|
+ } else {
|
||||||
|
+ setCupsOptionsFromItems(itm);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@@ -844,7 +975,7 @@ void QUnixPrintWidgetPrivate::setupPrinterProperties()
|
||||||
|
printerName = widget.printers->currentText();
|
||||||
|
}
|
||||||
|
|
||||||
|
- propertiesDialog = new QPrintPropertiesDialog(q->printer(), outputFormat, printerName, q);
|
||||||
|
+ propertiesDialog = new QPrintPropertiesDialog(q->printer(), &m_currentPrintDevice, outputFormat, printerName, q);
|
||||||
|
propertiesDialog->setResult(QDialog::Rejected);
|
||||||
|
propertiesDialogShown = false;
|
||||||
|
}
|
||||||
|
@@ -952,6 +1083,264 @@ void QUnixPrintWidget::updatePrinter()
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
+/*
|
||||||
|
+
|
||||||
|
+ QPPDOptionsModel
|
||||||
|
+
|
||||||
|
+ Holds the PPD Options for the printer.
|
||||||
|
+
|
||||||
|
+*/
|
||||||
|
+
|
||||||
|
+#if QT_CONFIG(cups)
|
||||||
|
+
|
||||||
|
+QPPDOptionsModel::QPPDOptionsModel(QPrintDevice *currentPrintDevice, QObject *parent)
|
||||||
|
+ : QAbstractItemModel(parent)
|
||||||
|
+ , m_currentPrintDevice(currentPrintDevice)
|
||||||
|
+{
|
||||||
|
+ ppd_file_t *ppd = m_currentPrintDevice->property(PDPK_PpdFile).value<ppd_file_t*>();
|
||||||
|
+ rootItem = new QOptionTreeItem(QOptionTreeItem::Root, 0, ppd, "Root Item", 0);
|
||||||
|
+
|
||||||
|
+ if (ppd) {
|
||||||
|
+ cupsCodec = QTextCodec::codecForName(ppd->lang_encoding);
|
||||||
|
+ for (int i = 0; i < ppd->num_groups; ++i) {
|
||||||
|
+ QOptionTreeItem *group = new QOptionTreeItem(QOptionTreeItem::Group, i, &ppd->groups[i], ppd->groups[i].text, rootItem);
|
||||||
|
+ rootItem->childItems.append(group);
|
||||||
|
+ parseGroups(group); // parse possible subgroups
|
||||||
|
+ parseOptions(group); // parse options
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (!cupsCodec)
|
||||||
|
+ cupsCodec = QTextCodec::codecForLocale();
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+int QPPDOptionsModel::columnCount(const QModelIndex &) const
|
||||||
|
+{
|
||||||
|
+ return 2;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+int QPPDOptionsModel::rowCount(const QModelIndex &parent) const
|
||||||
|
+{
|
||||||
|
+ QOptionTreeItem *itm;
|
||||||
|
+ if (!parent.isValid())
|
||||||
|
+ itm = rootItem;
|
||||||
|
+ else
|
||||||
|
+ itm = static_cast<QOptionTreeItem*>(parent.internalPointer());
|
||||||
|
+
|
||||||
|
+ if (itm->type == QOptionTreeItem::Option)
|
||||||
|
+ return 0;
|
||||||
|
+
|
||||||
|
+ return itm->childItems.count();
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+QVariant QPPDOptionsModel::data(const QModelIndex &index, int role) const
|
||||||
|
+{
|
||||||
|
+ if (!index.isValid())
|
||||||
|
+ return QVariant();
|
||||||
|
+
|
||||||
|
+ QOptionTreeItem *itm = static_cast<QOptionTreeItem*>(index.internalPointer());
|
||||||
|
+
|
||||||
|
+ switch (role) {
|
||||||
|
+ case Qt::FontRole: {
|
||||||
|
+ if (itm->type == QOptionTreeItem::Group){
|
||||||
|
+ QFont font;
|
||||||
|
+ font.setBold(true);
|
||||||
|
+ return QVariant(font);
|
||||||
|
+ }
|
||||||
|
+ return QVariant();
|
||||||
|
+ }
|
||||||
|
+ break;
|
||||||
|
+
|
||||||
|
+ case Qt::DisplayRole: {
|
||||||
|
+ if (index.column() == 0)
|
||||||
|
+ return cupsCodec->toUnicode(itm->description);
|
||||||
|
+ else if (itm->type == QOptionTreeItem::Option && itm->selected > -1)
|
||||||
|
+ return cupsCodec->toUnicode(itm->selDescription);
|
||||||
|
+ else
|
||||||
|
+ return QVariant();
|
||||||
|
+ }
|
||||||
|
+ break;
|
||||||
|
+
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return QVariant();
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+QModelIndex QPPDOptionsModel::index(int row, int column, const QModelIndex &parent) const
|
||||||
|
+{
|
||||||
|
+ QOptionTreeItem *itm;
|
||||||
|
+ if (!parent.isValid())
|
||||||
|
+ itm = rootItem;
|
||||||
|
+ else
|
||||||
|
+ itm = static_cast<QOptionTreeItem*>(parent.internalPointer());
|
||||||
|
+
|
||||||
|
+ return createIndex(row, column, itm->childItems.at(row));
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+QModelIndex QPPDOptionsModel::parent(const QModelIndex &index) const
|
||||||
|
+{
|
||||||
|
+ if (!index.isValid())
|
||||||
|
+ return QModelIndex();
|
||||||
|
+
|
||||||
|
+ QOptionTreeItem *itm = static_cast<QOptionTreeItem*>(index.internalPointer());
|
||||||
|
+
|
||||||
|
+ if (itm->parentItem && itm->parentItem != rootItem)
|
||||||
|
+ return createIndex(itm->parentItem->index, 0, itm->parentItem);
|
||||||
|
+
|
||||||
|
+ return QModelIndex();
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+Qt::ItemFlags QPPDOptionsModel::flags(const QModelIndex &index) const
|
||||||
|
+{
|
||||||
|
+ if (!index.isValid() || static_cast<QOptionTreeItem*>(index.internalPointer())->type == QOptionTreeItem::Group)
|
||||||
|
+ return Qt::ItemIsEnabled;
|
||||||
|
+
|
||||||
|
+ if (index.column() == 1)
|
||||||
|
+ return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable;
|
||||||
|
+
|
||||||
|
+ return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+void QPPDOptionsModel::parseGroups(QOptionTreeItem *parent)
|
||||||
|
+{
|
||||||
|
+ const ppd_group_t *group = static_cast<const ppd_group_t*>(parent->ptr);
|
||||||
|
+
|
||||||
|
+ if (group) {
|
||||||
|
+ for (int i = 0; i < group->num_subgroups; ++i) {
|
||||||
|
+ QOptionTreeItem *subgroup = new QOptionTreeItem(QOptionTreeItem::Group, i, &group->subgroups[i], group->subgroups[i].text, parent);
|
||||||
|
+ parent->childItems.append(subgroup);
|
||||||
|
+ parseGroups(subgroup); // parse possible subgroups
|
||||||
|
+ parseOptions(subgroup); // parse options
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static bool isBlacklistedOption(const char *keyword) Q_DECL_NOTHROW
|
||||||
|
+{
|
||||||
|
+ // We already let the user set these options elsewhere
|
||||||
|
+ const char *cupsOptionBlacklist[] = {
|
||||||
|
+ "Collate",
|
||||||
|
+ "Copies",
|
||||||
|
+ "OutputOrder",
|
||||||
|
+ "PageRegion",
|
||||||
|
+ "PageSize"
|
||||||
|
+ };
|
||||||
|
+ auto equals = [](const char *keyword) {
|
||||||
|
+ return [keyword](const char *candidate) {
|
||||||
|
+ return qstrcmp(keyword, candidate) == 0;
|
||||||
|
+ };
|
||||||
|
+ };
|
||||||
|
+ return std::any_of(std::begin(cupsOptionBlacklist), std::end(cupsOptionBlacklist), equals(keyword));
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+void QPPDOptionsModel::parseOptions(QOptionTreeItem *parent)
|
||||||
|
+{
|
||||||
|
+ const ppd_group_t *group = static_cast<const ppd_group_t*>(parent->ptr);
|
||||||
|
+ for (int i = 0; i < group->num_options; ++i) {
|
||||||
|
+ if (!isBlacklistedOption(group->options[i].keyword)) {
|
||||||
|
+ QOptionTreeItem *opt = new QOptionTreeItem(QOptionTreeItem::Option, i, &group->options[i], group->options[i].text, parent);
|
||||||
|
+ parent->childItems.append(opt);
|
||||||
|
+ parseChoices(opt);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+void QPPDOptionsModel::parseChoices(QOptionTreeItem *parent)
|
||||||
|
+{
|
||||||
|
+ const ppd_option_t *option = static_cast<const ppd_option_t*>(parent->ptr);
|
||||||
|
+ bool marked = false;
|
||||||
|
+ for (int i = 0; i < option->num_choices; ++i) {
|
||||||
|
+ QOptionTreeItem *choice = new QOptionTreeItem(QOptionTreeItem::Choice, i, &option->choices[i], option->choices[i].text, parent);
|
||||||
|
+ if (static_cast<int>(option->choices[i].marked) == 1) {
|
||||||
|
+ parent->selected = i;
|
||||||
|
+ parent->selDescription = option->choices[i].text;
|
||||||
|
+ marked = true;
|
||||||
|
+ } else if (!marked && qstrcmp(option->choices[i].choice, option->defchoice) == 0) {
|
||||||
|
+ parent->selected = i;
|
||||||
|
+ parent->selDescription = option->choices[i].text;
|
||||||
|
+ }
|
||||||
|
+ parent->childItems.append(choice);
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+QVariant QPPDOptionsModel::headerData(int section, Qt::Orientation, int role) const
|
||||||
|
+{
|
||||||
|
+ if (role != Qt::DisplayRole)
|
||||||
|
+ return QVariant();
|
||||||
|
+
|
||||||
|
+ switch (section) {
|
||||||
|
+ case 0:
|
||||||
|
+ return QVariant(tr("Name"));
|
||||||
|
+ case 1:
|
||||||
|
+ return QVariant(tr("Value"));
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return QVariant();
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+////////////////////////////////////////////////////////////////////////////////
|
||||||
|
+////////////////////////////////////////////////////////////////////////////////
|
||||||
|
+
|
||||||
|
+/*
|
||||||
|
+
|
||||||
|
+ QPPDOptionsEditor
|
||||||
|
+
|
||||||
|
+ Edits the PPD Options for the printer.
|
||||||
|
+
|
||||||
|
+*/
|
||||||
|
+
|
||||||
|
+QWidget *QPPDOptionsEditor::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
|
||||||
|
+{
|
||||||
|
+ Q_UNUSED(option)
|
||||||
|
+
|
||||||
|
+ if (index.column() == 1 && static_cast<QOptionTreeItem*>(index.internalPointer())->type == QOptionTreeItem::Option)
|
||||||
|
+ return new QComboBox(parent);
|
||||||
|
+
|
||||||
|
+ return nullptr;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+void QPPDOptionsEditor::setEditorData(QWidget *editor, const QModelIndex &index) const
|
||||||
|
+{
|
||||||
|
+ if (index.column() != 1)
|
||||||
|
+ return;
|
||||||
|
+
|
||||||
|
+ QComboBox *cb = static_cast<QComboBox*>(editor);
|
||||||
|
+ QOptionTreeItem *itm = static_cast<QOptionTreeItem*>(index.internalPointer());
|
||||||
|
+
|
||||||
|
+ if (itm->selected == -1)
|
||||||
|
+ cb->addItem(QString());
|
||||||
|
+
|
||||||
|
+ const QPPDOptionsModel *m = static_cast<const QPPDOptionsModel*>(index.model());
|
||||||
|
+ for (auto *childItem : qAsConst(itm->childItems))
|
||||||
|
+ cb->addItem(m->cupsCodec->toUnicode(childItem->description));
|
||||||
|
+
|
||||||
|
+ if (itm->selected > -1)
|
||||||
|
+ cb->setCurrentIndex(itm->selected);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+void QPPDOptionsEditor::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
|
||||||
|
+{
|
||||||
|
+ QComboBox *cb = static_cast<QComboBox*>(editor);
|
||||||
|
+ QOptionTreeItem *itm = static_cast<QOptionTreeItem*>(index.internalPointer());
|
||||||
|
+
|
||||||
|
+ if (itm->selected == cb->currentIndex())
|
||||||
|
+ return;
|
||||||
|
+
|
||||||
|
+ const ppd_option_t *opt = static_cast<const ppd_option_t*>(itm->ptr);
|
||||||
|
+ QPPDOptionsModel *m = static_cast<QPPDOptionsModel*>(model);
|
||||||
|
+
|
||||||
|
+ const auto values = QStringList{} << QString::fromLatin1(opt->keyword) << QString::fromLatin1(opt->choices[cb->currentIndex()].choice);
|
||||||
|
+ if (m->m_currentPrintDevice->setProperty(PDPK_PpdOption, values)) {
|
||||||
|
+ itm->selected = cb->currentIndex();
|
||||||
|
+ itm->selDescription = static_cast<const ppd_option_t*>(itm->ptr)->choices[itm->selected].text;
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+////////////////////////////////////////////////////////////////////////////////
|
||||||
|
+////////////////////////////////////////////////////////////////////////////////
|
||||||
|
+
|
||||||
|
+#endif // QT_CONFIG(cups)
|
||||||
|
#endif // defined (Q_OS_UNIX)
|
||||||
|
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
diff --git a/src/printsupport/dialogs/qprintpropertieswidget.ui b/src/printsupport/dialogs/qprintpropertieswidget.ui
|
||||||
|
index 66d7b80fcd..0e56fb33df 100644
|
||||||
|
--- a/src/printsupport/dialogs/qprintpropertieswidget.ui
|
||||||
|
+++ b/src/printsupport/dialogs/qprintpropertieswidget.ui
|
||||||
|
@@ -32,6 +32,20 @@
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
+ <widget class="QWidget" name="cupsPropertiesPage" >
|
||||||
|
+ <attribute name="title" >
|
||||||
|
+ <string>Advanced</string>
|
||||||
|
+ </attribute>
|
||||||
|
+ <layout class="QHBoxLayout" name="horizontalLayout_2" >
|
||||||
|
+ <item>
|
||||||
|
+ <widget class="QTreeView" name="treeView" >
|
||||||
|
+ <property name="alternatingRowColors" >
|
||||||
|
+ <bool>true</bool>
|
||||||
|
+ </property>
|
||||||
|
+ </widget>
|
||||||
|
+ </item>
|
||||||
|
+ </layout>
|
||||||
|
+ </widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
--
|
||||||
|
2.15.1
|
||||||
|
|
32
0011-QtPrintSupport-Fix-build.patch
Normal file
32
0011-QtPrintSupport-Fix-build.patch
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
From e31c79ece49f0893882f9062edc9664926b9b13f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
||||||
|
Date: Mon, 18 Dec 2017 09:31:11 +0100
|
||||||
|
Subject: [PATCH 54/54] QtPrintSupport: Fix build
|
||||||
|
|
||||||
|
dialogs/qprintdialog_unix.cpp:1104:21: error: incomplete type 'QTextCodec' used in nested name specifier
|
||||||
|
|
||||||
|
Amends b4330bc391bbb08898f192ea3469b73aed09134c.
|
||||||
|
|
||||||
|
Task-number: QTBUG-54464
|
||||||
|
Change-Id: I555431d11a5c3f247d4f055d94255d2708c92374
|
||||||
|
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
|
||||||
|
Reviewed-by: David Faure <david.faure@kdab.com>
|
||||||
|
---
|
||||||
|
src/printsupport/dialogs/qprintdialog_unix.cpp | 1 +
|
||||||
|
1 file changed, 1 insertion(+)
|
||||||
|
|
||||||
|
diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp
|
||||||
|
index d5ad90e85e..9ad9fa35a5 100644
|
||||||
|
--- a/src/printsupport/dialogs/qprintdialog_unix.cpp
|
||||||
|
+++ b/src/printsupport/dialogs/qprintdialog_unix.cpp
|
||||||
|
@@ -49,6 +49,7 @@
|
||||||
|
#include "qfiledialog.h"
|
||||||
|
#endif
|
||||||
|
#include <QtCore/qdir.h>
|
||||||
|
+#include <QtCore/qtextcodec.h>
|
||||||
|
#include <QtGui/qevent.h>
|
||||||
|
#if QT_CONFIG(filesystemmodel)
|
||||||
|
#include <QtWidgets/qfilesystemmodel.h>
|
||||||
|
--
|
||||||
|
2.15.1
|
||||||
|
|
@ -1,8 +1,8 @@
|
|||||||
Index: qtbase-opensource-src-5.9.2/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
|
Index: qtbase-opensource-src-5.9.1/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
|
||||||
===================================================================
|
===================================================================
|
||||||
--- qtbase-opensource-src-5.9.2.orig/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
|
--- qtbase-opensource-src-5.9.1.orig/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
|
||||||
+++ qtbase-opensource-src-5.9.2/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
|
+++ qtbase-opensource-src-5.9.1/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
|
||||||
@@ -859,7 +859,9 @@ QStringList QGenericUnixTheme::themeName
|
@@ -828,7 +828,9 @@ QStringList QGenericUnixTheme::themeName
|
||||||
result.push_back(QLatin1String(QKdeTheme::name));
|
result.push_back(QLatin1String(QKdeTheme::name));
|
||||||
#endif
|
#endif
|
||||||
} else if (gtkBasedEnvironments.contains(desktopName)) {
|
} else if (gtkBasedEnvironments.contains(desktopName)) {
|
||||||
|
@ -1,3 +1,53 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Dec 20 10:41:16 UTC 2017 - alarrosa@suse.com
|
||||||
|
|
||||||
|
- 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)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Dec 15 17:08:31 UTC 2017 - alarrosa@suse.com
|
||||||
|
|
||||||
|
- 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.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Dec 8 23:11:00 UTC 2017 - christophe@krop.fr
|
||||||
|
|
||||||
|
- Update the license tag (boo#967696)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Dec 7 12:18:04 UTC 2017 - fabian@ritter-vogt.de
|
||||||
|
|
||||||
|
- Update to 5.10.0 final
|
||||||
|
* New bugfix release
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Sun Dec 3 14:12:46 UTC 2017 - fabian@ritter-vogt.de
|
||||||
|
|
||||||
|
- Update to 5.10.0 RC 2
|
||||||
|
* New bugfix release
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Nov 30 09:47:10 UTC 2017 - fabian@ritter-vogt.de
|
||||||
|
|
||||||
|
- Update to 5.10.0 RC 1
|
||||||
|
* New bugfix release
|
||||||
|
- Refresh tell-the-truth-about-private-api.patch
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sat Nov 25 12:46:32 UTC 2017 - fabian@ritter-vogt.de
|
Sat Nov 25 12:46:32 UTC 2017 - fabian@ritter-vogt.de
|
||||||
|
|
||||||
@ -8,11 +58,47 @@ Sat Nov 25 12:46:32 UTC 2017 - fabian@ritter-vogt.de
|
|||||||
- Drop patches, now upstream:
|
- Drop patches, now upstream:
|
||||||
* qglxconvenience-avoid-null-pointer-deref.patch
|
* qglxconvenience-avoid-null-pointer-deref.patch
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Nov 15 11:41:32 UTC 2017 - fabian@ritter-vogt.de
|
||||||
|
|
||||||
|
- Update to 5.10 Beta 4
|
||||||
|
- Contains bugfixes
|
||||||
|
- Refresh tell-the-truth-about-private-api.patch
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Nov 2 07:22:12 UTC 2017 - fabian@ritter-vogt.de
|
||||||
|
|
||||||
|
- Update to 5.10 Beta 3
|
||||||
|
- Contains bugfixes
|
||||||
|
- Remove patches, now upstream:
|
||||||
|
* 0001-Cups-Check-the-created-QPrintDevice-is-valid-before-.patch
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Oct 30 16:19:18 UTC 2017 - fabian@ritter-vogt.de
|
||||||
|
|
||||||
|
- Update to 5.10 Beta 2
|
||||||
|
- Contains bugfixes
|
||||||
|
- Remove patches, now upstream:
|
||||||
|
* qglxconvenience-avoid-null-pointer-deref.patch
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Fri Oct 27 18:52:40 UTC 2017 - fabian@ritter-vogt.de
|
Fri Oct 27 18:52:40 UTC 2017 - fabian@ritter-vogt.de
|
||||||
|
|
||||||
- Update 0001-QSslSocket-OpenSSL-1.1-backend.patch from git
|
- Update 0001-QSslSocket-OpenSSL-1.1-backend.patch from git
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Oct 24 18:26:45 UTC 2017 - fabian@ritter-vogt.de
|
||||||
|
|
||||||
|
- Add patch to potentially fix printing:
|
||||||
|
* 0001-Cups-Check-the-created-QPrintDevice-is-valid-before-.patch
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Oct 9 16:17:18 UTC 2017 - fabian@ritter-vogt.de
|
||||||
|
|
||||||
|
- Update to 5.10 Beta 1
|
||||||
|
- For more information visit:
|
||||||
|
https://blog.qt.io/blog/2017/10/09/qt-5-10-beta-released/
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sun Oct 8 13:54:30 UTC 2017 - lbeltrame@kde.org
|
Sun Oct 8 13:54:30 UTC 2017 - lbeltrame@kde.org
|
||||||
|
|
||||||
@ -32,6 +118,56 @@ Fri Sep 29 15:16:44 UTC 2017 - jengelh@inai.de
|
|||||||
- Update package descriptions and grouping.
|
- Update package descriptions and grouping.
|
||||||
- Use find -exec's "+" strategy
|
- Use find -exec's "+" strategy
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Sep 25 14:42:37 CEST 2017 - fabian@ritter-vogt.de
|
||||||
|
|
||||||
|
- Update to 5.10 Alpha 1:
|
||||||
|
* Qt Core
|
||||||
|
+ Added rudimentary implementation of QStringView. It is missing some (important) const-QString functions, but is fully functional as an interface type. To be completed for Qt 5.11.
|
||||||
|
+ Added many more functions to QLatin1String, too, co-evolving QLatin1String as the const char*-Latin-1-version of QStringView.
|
||||||
|
+ Added QIODevice::skip() to improve performance in read operations.
|
||||||
|
+ Explicitly little and big-endian integer types exposed (for instance qint16_le, quint32_be) for machine-independent data-type parsing.
|
||||||
|
+ Added QRandomGenerator providing a simple API for high-quality (optionally seed-less) random numbers.
|
||||||
|
+ Added accessors for metadata time fields of files to QFileInfo.
|
||||||
|
+ Added QSemaphoreReleaser a RAII-style class for QSemaphore.
|
||||||
|
+ Added QKeyValueIterator for more efficient iteration over keys of an associative container
|
||||||
|
|
||||||
|
* Qt GUI
|
||||||
|
+ Added cross-platform Vulkan enablers for Windows, Linux (xcb) and Android (level 23+): QVulkanInstance, QWindow with type VulkanSurface, and QVulkanWindow
|
||||||
|
+ Added new flags and functions to QSurfaceFormat and QOpenGLWidget to request sRGB-capable default/backing framebuffers
|
||||||
|
+ The OpenGL ES 3.2 API is now exposed in a cross-platform manner via QOpenGLExtraFunctions.
|
||||||
|
+ QImages can now use more than 2GByte of pixel data.
|
||||||
|
+ Added QFont::PreferNoShaping style strategy.
|
||||||
|
|
||||||
|
* Qt Widgets
|
||||||
|
+ QWidget::createWindowContainer() is now functional on Android
|
||||||
|
+ QOpenGLWidget is now usable for rendering and reading back (grabbing) offscreen content.
|
||||||
|
+ Added AA_DisableWindowContextHelpButton attribute that prevents the automatic" What's this" button on dialogs on Windows
|
||||||
|
+ Added tabStopDistance property in QTextOption, QTextEdit and QPlainTextEdit
|
||||||
|
+ Added selectionEnd(), selectionLength() to QLineEdit, complementing selectionStart()
|
||||||
|
+ Added setDoubleStep to QInputDialog, to enable changing of the step amount for getDouble()
|
||||||
|
+ Added isPersistentEditorOpen() to QAbstractItemView, QTreeWidget, QTableWidget and QListWidget
|
||||||
|
+ Added new style hint: SH_TitleBar_ShowToolTipsOnButtons
|
||||||
|
+ Added support for specifying custom internal texture formats in QOpenGLWidget
|
||||||
|
+ QDockWidget acquired the ability to be dropped together side by side
|
||||||
|
|
||||||
|
* Qt Network
|
||||||
|
+ OpenSSL 1.1 back-end.
|
||||||
|
+ Persistent store of HSTS policies in QNAM (QSettings-based).
|
||||||
|
+ Implemented the h2c procotol upgrade used by non-SSL HTTP/2.
|
||||||
|
- For more information visit:
|
||||||
|
https://blog.qt.io/blog/2017/09/13/qt-5-10-alpha-released/
|
||||||
|
- Remove patches, now upstream:
|
||||||
|
* de63bbd2f806b0219a60775017899cedb121581f.patch
|
||||||
|
* 0001-Fix-Qt5DBusMacros.cmake-for-CMake-3.9.patch
|
||||||
|
* 0001-QSslSocket-OpenSSL-1.1-backend.patch
|
||||||
|
* 0001-Fix-open-chmod-race-condition-in-QSaveFile.patch
|
||||||
|
* 0001-Fix-at-spi2-build.patch
|
||||||
|
* dont-abort-missing-display.patch
|
||||||
|
- Refresh qglxconvenience-avoid-null-pointer-deref.patch
|
||||||
|
- Build against pcre2
|
||||||
|
- Enable EGLFS with GBM, SCTP, Vulkan
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed Sep 13 12:38:49 UTC 2017 - fabian@ritter-vogt.de
|
Wed Sep 13 12:38:49 UTC 2017 - fabian@ritter-vogt.de
|
||||||
|
|
||||||
|
@ -20,23 +20,30 @@
|
|||||||
%define journald 0
|
%define journald 0
|
||||||
|
|
||||||
%ifarch %arm aarch64
|
%ifarch %arm aarch64
|
||||||
%define gles 1
|
%global gles 1
|
||||||
%else
|
%else
|
||||||
%define gles 0
|
%global gles 0
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%if 0%{?suse_version} >= 1330
|
||||||
|
%global vulkan 1
|
||||||
|
%else
|
||||||
|
# Vulkan headers too old
|
||||||
|
%global vulkan 0
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
Name: libqt5-qtbase
|
Name: libqt5-qtbase
|
||||||
Version: 5.9.3
|
Version: 5.10.0
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: C++ Program Library, Core Components
|
Summary: C++ Program Library, Core Components
|
||||||
License: GPL-3.0 or SUSE-LGPL-2.1-with-digia-exception-1.1
|
License: LGPL-2.1-with-Qt-Company-Qt-exception-1.1 or LGPL-3.0-with-Qt-Company-Qt-exception-1.1
|
||||||
Group: System/Libraries
|
Group: System/Libraries
|
||||||
Url: https://www.qt.io
|
Url: https://www.qt.io
|
||||||
%define base_name libqt5
|
%define base_name libqt5
|
||||||
%define real_version 5.9.3
|
%define real_version 5.10.0
|
||||||
%define so_version 5.9.3
|
%define so_version 5.10.0
|
||||||
%define tar_version qtbase-opensource-src-%{real_version}
|
%define tar_version qtbase-everywhere-src-5.10.0
|
||||||
Source: https://download.qt.io/official_releases/qt/5.9/%{real_version}/submodules/%{tar_version}.tar.xz
|
Source: https://download.qt.io/official_releases/qt/5.10/%{real_version}/submodules/%{tar_version}.tar.xz
|
||||||
# to get mtime of file:
|
# to get mtime of file:
|
||||||
Source1: libqt5-qtbase.changes
|
Source1: libqt5-qtbase.changes
|
||||||
Source2: macros.qt5
|
Source2: macros.qt5
|
||||||
@ -53,14 +60,25 @@ Patch8: tell-the-truth-about-private-api.patch
|
|||||||
# PATCH-FIX-OPENSUSE libqt5-prioritise-gtk2-platformtheme.patch boo#1002900 -- Give Gtk2 Platform Theme (from qtstyleplugins) a priority over Gtk3 PT which currently lacks QGtk3Style.
|
# PATCH-FIX-OPENSUSE libqt5-prioritise-gtk2-platformtheme.patch boo#1002900 -- Give Gtk2 Platform Theme (from qtstyleplugins) a priority over Gtk3 PT which currently lacks QGtk3Style.
|
||||||
Patch10: libqt5-prioritise-gtk2-platformtheme.patch
|
Patch10: libqt5-prioritise-gtk2-platformtheme.patch
|
||||||
# PATCH-FEATURE-OPENSUSE 0001-Add-remote-print-queue-support.patch fate#322052 -- Automatically recognize and allow printing to remote cups servers
|
# PATCH-FEATURE-OPENSUSE 0001-Add-remote-print-queue-support.patch fate#322052 -- Automatically recognize and allow printing to remote cups servers
|
||||||
Patch11: 0001-Add-remote-print-queue-support.patch
|
Patch12: 0001-Add-remote-print-queue-support.patch
|
||||||
# PATCH-FIX-OPENSUSE
|
# PATCH-FIX-OPENSUSE
|
||||||
Patch12: force-cmake-private-headers.patch
|
Patch15: force-cmake-private-headers.patch
|
||||||
# PATCH-FIX-UPSTREAM
|
# PATCH-FIX-UPSTREAM
|
||||||
Patch13: qapplication-emit-palettechanged.patch
|
Patch17: qapplication-emit-palettechanged.patch
|
||||||
# patches 1000-2000 and above from upstream 5.9 branch #
|
# patches 1000- 2000 and above from upstream 5.10 branch #
|
||||||
# patches 2000-3000 and above from upstream 5.10/dev branch #
|
# patches 2000-3000 and above from upstream 5.11/dev branch #
|
||||||
Patch2000: 0001-QSslSocket-OpenSSL-1.1-backend.patch
|
Patch2000: 0001-Remove-QPrintDialogPrivate-applyPrinterProperties-no.patch
|
||||||
|
Patch2001: 0002-Remove-QUnixPrintWidgetPrivate-applyPrinterPropertie.patch
|
||||||
|
Patch2002: 0003-Remove-QPrintPropertiesDialog-applyPrinterProperties.patch
|
||||||
|
Patch2003: 0004-Remove-QCupsJobWidget-setPrinter.patch
|
||||||
|
Patch2004: 0005-Remove-QPrintPropertiesDialog-selectPrinter.patch
|
||||||
|
Patch2005: 0006-Remove-QPageSetupWidget-selectPrinter.patch
|
||||||
|
Patch2006: 0007-Introduce-QPrintDevice-property-setProperty.patch
|
||||||
|
Patch2007: 0008-Allow-access-to-ppd-file-and-ppdMarkOption-via-QPpdP.patch
|
||||||
|
Patch2008: 0009-QPlatformPrintDevice-use-QVector-not-QList-in-the-AP.patch
|
||||||
|
Patch2009: 0010-Reintroduce-the-Advanced-tab-in-the-QPrintProperties.patch
|
||||||
|
Patch2010: 0011-QtPrintSupport-Fix-build.patch
|
||||||
|
Patch2011: 0001-Fix-custom-page-size-handling-in-the-Unix-print-dial.patch
|
||||||
BuildRequires: alsa-devel
|
BuildRequires: alsa-devel
|
||||||
BuildRequires: cups-devel
|
BuildRequires: cups-devel
|
||||||
BuildRequires: double-conversion-devel
|
BuildRequires: double-conversion-devel
|
||||||
@ -70,9 +88,11 @@ BuildRequires: libmng-devel
|
|||||||
BuildRequires: libmysqlclient-devel
|
BuildRequires: libmysqlclient-devel
|
||||||
BuildRequires: libpng-devel
|
BuildRequires: libpng-devel
|
||||||
BuildRequires: libproxy-devel
|
BuildRequires: libproxy-devel
|
||||||
|
BuildRequires: lksctp-tools-devel
|
||||||
BuildRequires: libtiff-devel
|
BuildRequires: libtiff-devel
|
||||||
BuildRequires: openssl-devel
|
BuildRequires: openssl-devel
|
||||||
BuildRequires: pcre-devel
|
BuildRequires: pcre-devel
|
||||||
|
BuildRequires: pcre2-devel
|
||||||
BuildRequires: pkgconfig
|
BuildRequires: pkgconfig
|
||||||
BuildRequires: pkgconfig(mtdev)
|
BuildRequires: pkgconfig(mtdev)
|
||||||
%if %qt5_snapshot
|
%if %qt5_snapshot
|
||||||
@ -86,15 +106,18 @@ BuildRequires: pkgconfig(dbus-1)
|
|||||||
BuildRequires: pkgconfig(egl)
|
BuildRequires: pkgconfig(egl)
|
||||||
BuildRequires: pkgconfig(fontconfig)
|
BuildRequires: pkgconfig(fontconfig)
|
||||||
BuildRequires: pkgconfig(freetype2)
|
BuildRequires: pkgconfig(freetype2)
|
||||||
|
BuildRequires: pkgconfig(gbm)
|
||||||
BuildRequires: pkgconfig(gl)
|
BuildRequires: pkgconfig(gl)
|
||||||
%if %gles
|
%if %gles
|
||||||
BuildRequires: Mesa-libGLESv3-devel
|
BuildRequires: Mesa-libGLESv3-devel
|
||||||
BuildRequires: pkgconfig(gbm)
|
|
||||||
BuildRequires: pkgconfig(glesv2)
|
BuildRequires: pkgconfig(glesv2)
|
||||||
%endif
|
%endif
|
||||||
BuildRequires: libicu-devel
|
BuildRequires: libicu-devel
|
||||||
BuildRequires: libpulse-devel
|
BuildRequires: libpulse-devel
|
||||||
BuildRequires: tslib-devel
|
BuildRequires: tslib-devel
|
||||||
|
%if %{vulkan}
|
||||||
|
BuildRequires: vulkan-devel
|
||||||
|
%endif
|
||||||
BuildRequires: xcb-util-image-devel
|
BuildRequires: xcb-util-image-devel
|
||||||
BuildRequires: xcb-util-keysyms-devel
|
BuildRequires: xcb-util-keysyms-devel
|
||||||
BuildRequires: xcb-util-renderutil-devel
|
BuildRequires: xcb-util-renderutil-devel
|
||||||
@ -138,16 +161,27 @@ handling.
|
|||||||
%define libqt5_translationdir %{libqt5_datadir}/translations
|
%define libqt5_translationdir %{libqt5_datadir}/translations
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n qtbase-opensource-src-%{real_version}
|
%setup -q -n %{tar_version}
|
||||||
%patch3 -p1
|
%patch3 -p1
|
||||||
%patch5 -p1
|
%patch5 -p1
|
||||||
%patch6 -p1
|
%patch6 -p1
|
||||||
%patch8 -p1
|
%patch8 -p1
|
||||||
%patch10 -p1
|
%patch10 -p1
|
||||||
%patch11 -p1
|
|
||||||
%patch12 -p1
|
%patch12 -p1
|
||||||
%patch13 -p1
|
%patch15 -p1
|
||||||
|
%patch17 -p1
|
||||||
%patch2000 -p1
|
%patch2000 -p1
|
||||||
|
%patch2001 -p1
|
||||||
|
%patch2002 -p1
|
||||||
|
%patch2003 -p1
|
||||||
|
%patch2004 -p1
|
||||||
|
%patch2005 -p1
|
||||||
|
%patch2006 -p1
|
||||||
|
%patch2007 -p1
|
||||||
|
%patch2008 -p1
|
||||||
|
%patch2009 -p1
|
||||||
|
%patch2010 -p1
|
||||||
|
%patch2011 -p1
|
||||||
|
|
||||||
# be sure not to use them
|
# be sure not to use them
|
||||||
rm -rf src/3rdparty/{libjpeg,freetype,zlib}
|
rm -rf src/3rdparty/{libjpeg,freetype,zlib}
|
||||||
@ -588,6 +622,9 @@ Requires: pkgconfig(glesv2)
|
|||||||
%else
|
%else
|
||||||
Requires: pkgconfig(gl)
|
Requires: pkgconfig(gl)
|
||||||
%endif
|
%endif
|
||||||
|
%if %{vulkan}
|
||||||
|
Requires: vulkan-devel
|
||||||
|
%endif
|
||||||
Requires: pkgconfig(egl)
|
Requires: pkgconfig(egl)
|
||||||
Requires: pkgconfig(libdrm)
|
Requires: pkgconfig(libdrm)
|
||||||
|
|
||||||
@ -777,18 +814,12 @@ Recommends: libqt5-qtbase-devel
|
|||||||
Examples for the libqt5-qtbase modules.
|
Examples for the libqt5-qtbase modules.
|
||||||
|
|
||||||
%build
|
%build
|
||||||
#export QMAKESPEC=$PWD/mkspecs/linux-g++
|
|
||||||
%ifarch ppc64
|
%ifarch ppc64
|
||||||
RPM_OPT_FLAGS="%{optflags} -mminimal-toc"
|
RPM_OPT_FLAGS="%{optflags} -mminimal-toc"
|
||||||
%endif
|
%endif
|
||||||
export CXXFLAGS="$CXXFLAGS %{optflags} -DOPENSSL_LOAD_CONF"
|
export CXXFLAGS="$CXXFLAGS %{optflags} -DOPENSSL_LOAD_CONF"
|
||||||
export CFLAGS="$CFLAGS %{optflags} -DOPENSSL_LOAD_CONF"
|
export CFLAGS="$CFLAGS %{optflags} -DOPENSSL_LOAD_CONF"
|
||||||
export MAKEFLAGS="%{?_smp_mflags}"
|
export MAKEFLAGS="%{?_smp_mflags}"
|
||||||
%ifarch sparc64
|
|
||||||
platform="-platform linux-g++-64"
|
|
||||||
%else
|
|
||||||
platform=""
|
|
||||||
%endif
|
|
||||||
%define xkbconfigroot %(pkg-config --variable=xkb_base xkeyboard-config)
|
%define xkbconfigroot %(pkg-config --variable=xkb_base xkeyboard-config)
|
||||||
#if %qt5_snapshot
|
#if %qt5_snapshot
|
||||||
#force the configure script to generate the forwarding headers (it checks whether .git directory exists)
|
#force the configure script to generate the forwarding headers (it checks whether .git directory exists)
|
||||||
@ -800,7 +831,7 @@ sed -i 's|qt_instdate=`date +%Y-%m-%d`|qt_instdate=$CHANGES|g' configure
|
|||||||
# so non-qt5 apps/libs don't get stripped
|
# so non-qt5 apps/libs don't get stripped
|
||||||
sed -i -e 's|^\(QMAKE_STRIP.*=\).*$|\1|g' mkspecs/common/linux.conf
|
sed -i -e 's|^\(QMAKE_STRIP.*=\).*$|\1|g' mkspecs/common/linux.conf
|
||||||
|
|
||||||
echo yes | ./configure $platform \
|
echo yes | ./configure \
|
||||||
-prefix %{_prefix} \
|
-prefix %{_prefix} \
|
||||||
-L %{libqt5_libdir} \
|
-L %{libqt5_libdir} \
|
||||||
-libdir %{libqt5_libdir} \
|
-libdir %{libqt5_libdir} \
|
||||||
@ -822,11 +853,10 @@ echo yes | ./configure $platform \
|
|||||||
-no-reduce-relocations \
|
-no-reduce-relocations \
|
||||||
%endif
|
%endif
|
||||||
%ifarch %ix86
|
%ifarch %ix86
|
||||||
%if 0%{?sle_version:%sle_version} < 150000
|
%if 0%{?sle_version} < 150000
|
||||||
-no-sse2 -no-pch \
|
-no-sse2 -no-pch \
|
||||||
%endif
|
%endif
|
||||||
%endif
|
%endif
|
||||||
-optimized-qmake \
|
|
||||||
-accessibility \
|
-accessibility \
|
||||||
-no-strip \
|
-no-strip \
|
||||||
-opensource \
|
-opensource \
|
||||||
@ -847,6 +877,7 @@ echo yes | ./configure $platform \
|
|||||||
-system-zlib \
|
-system-zlib \
|
||||||
-no-pch \
|
-no-pch \
|
||||||
-glib \
|
-glib \
|
||||||
|
-sctp \
|
||||||
-system-sqlite \
|
-system-sqlite \
|
||||||
-no-sql-mysql \
|
-no-sql-mysql \
|
||||||
-no-strip \
|
-no-strip \
|
||||||
@ -858,7 +889,7 @@ echo yes | ./configure $platform \
|
|||||||
-egl \
|
-egl \
|
||||||
-eglfs \
|
-eglfs \
|
||||||
%if %gles
|
%if %gles
|
||||||
-eglfs -kms \
|
-kms \
|
||||||
-opengl es2 \
|
-opengl es2 \
|
||||||
%else
|
%else
|
||||||
-opengl desktop \
|
-opengl desktop \
|
||||||
@ -875,7 +906,7 @@ make %{?_smp_mflags}
|
|||||||
make INSTALL_ROOT=%{buildroot} install
|
make INSTALL_ROOT=%{buildroot} install
|
||||||
|
|
||||||
%ifarch %ix86
|
%ifarch %ix86
|
||||||
%if 0%{?sle_version:%sle_version} < 150000
|
%if 0%{?sle_version} < 150000
|
||||||
install -d %{buildroot}%{libqt5_libdir}/sse2/
|
install -d %{buildroot}%{libqt5_libdir}/sse2/
|
||||||
|
|
||||||
pushd src/corelib; make clean ; ../../bin/qmake -config sse2; make %{?_smp_mflags}
|
pushd src/corelib; make clean ; ../../bin/qmake -config sse2; make %{?_smp_mflags}
|
||||||
@ -982,6 +1013,8 @@ popd
|
|||||||
%{libqt5_bindir}/rcc*
|
%{libqt5_bindir}/rcc*
|
||||||
%{_bindir}/uic*
|
%{_bindir}/uic*
|
||||||
%{libqt5_bindir}/uic*
|
%{libqt5_bindir}/uic*
|
||||||
|
%{_bindir}/qvkgen*
|
||||||
|
%{libqt5_bindir}/qvkgen*
|
||||||
%{_bindir}/syncqt.pl*
|
%{_bindir}/syncqt.pl*
|
||||||
%{_bindir}/fixqt4headers.pl*
|
%{_bindir}/fixqt4headers.pl*
|
||||||
%{libqt5_bindir}/syncqt.pl*
|
%{libqt5_bindir}/syncqt.pl*
|
||||||
@ -999,7 +1032,7 @@ popd
|
|||||||
%doc *.txt LICENSE.*
|
%doc *.txt LICENSE.*
|
||||||
%{libqt5_libdir}/libQt5Core.so.*
|
%{libqt5_libdir}/libQt5Core.so.*
|
||||||
%ifarch %ix86
|
%ifarch %ix86
|
||||||
%if 0%{?sle_version:%sle_version} < 150000
|
%if 0%{?sle_version} < 150000
|
||||||
%dir %{libqt5_libdir}/sse2
|
%dir %{libqt5_libdir}/sse2
|
||||||
%{libqt5_libdir}/sse2/libQt5Core.so.*
|
%{libqt5_libdir}/sse2/libQt5Core.so.*
|
||||||
%endif
|
%endif
|
||||||
@ -1275,6 +1308,12 @@ popd
|
|||||||
%{libqt5_libdir}/libQt5ServiceSupport.prl
|
%{libqt5_libdir}/libQt5ServiceSupport.prl
|
||||||
%{libqt5_libdir}/libQt5ThemeSupport.a
|
%{libqt5_libdir}/libQt5ThemeSupport.a
|
||||||
%{libqt5_libdir}/libQt5ThemeSupport.prl
|
%{libqt5_libdir}/libQt5ThemeSupport.prl
|
||||||
|
%{libqt5_libdir}/libQt5EdidSupport.a
|
||||||
|
%{libqt5_libdir}/libQt5EdidSupport.prl
|
||||||
|
%if %{vulkan}
|
||||||
|
%{libqt5_libdir}/libQt5VulkanSupport.a
|
||||||
|
%{libqt5_libdir}/libQt5VulkanSupport.prl
|
||||||
|
%endif
|
||||||
%{libqt5_includedir}/QtAccessibilitySupport/
|
%{libqt5_includedir}/QtAccessibilitySupport/
|
||||||
%{libqt5_includedir}/QtDeviceDiscoverySupport/
|
%{libqt5_includedir}/QtDeviceDiscoverySupport/
|
||||||
%{libqt5_includedir}/QtEglSupport/
|
%{libqt5_includedir}/QtEglSupport/
|
||||||
@ -1289,6 +1328,10 @@ popd
|
|||||||
%{libqt5_includedir}/QtPlatformCompositorSupport/
|
%{libqt5_includedir}/QtPlatformCompositorSupport/
|
||||||
%{libqt5_includedir}/QtServiceSupport/
|
%{libqt5_includedir}/QtServiceSupport/
|
||||||
%{libqt5_includedir}/QtThemeSupport/
|
%{libqt5_includedir}/QtThemeSupport/
|
||||||
|
%{libqt5_includedir}/QtEdidSupport/
|
||||||
|
%if %{vulkan}
|
||||||
|
%{libqt5_includedir}/QtVulkanSupport/
|
||||||
|
%endif
|
||||||
%exclude %{libqt5_includedir}/QtAccessibilitySupport/%{so_version}/
|
%exclude %{libqt5_includedir}/QtAccessibilitySupport/%{so_version}/
|
||||||
%exclude %{libqt5_includedir}/QtDeviceDiscoverySupport/%{so_version}/
|
%exclude %{libqt5_includedir}/QtDeviceDiscoverySupport/%{so_version}/
|
||||||
%exclude %{libqt5_includedir}/QtEglSupport/%{so_version}/
|
%exclude %{libqt5_includedir}/QtEglSupport/%{so_version}/
|
||||||
@ -1303,6 +1346,10 @@ popd
|
|||||||
%exclude %{libqt5_includedir}/QtPlatformCompositorSupport/%{so_version}/
|
%exclude %{libqt5_includedir}/QtPlatformCompositorSupport/%{so_version}/
|
||||||
%exclude %{libqt5_includedir}/QtServiceSupport/%{so_version}/
|
%exclude %{libqt5_includedir}/QtServiceSupport/%{so_version}/
|
||||||
%exclude %{libqt5_includedir}/QtThemeSupport/%{so_version}/
|
%exclude %{libqt5_includedir}/QtThemeSupport/%{so_version}/
|
||||||
|
%exclude %{libqt5_includedir}/QtEdidSupport/%{so_version}/
|
||||||
|
%if %{vulkan}
|
||||||
|
%exclude %{libqt5_includedir}/QtVulkanSupport/%{so_version}/
|
||||||
|
%endif
|
||||||
|
|
||||||
%files -n libQt5KmsSupport-devel-static
|
%files -n libQt5KmsSupport-devel-static
|
||||||
%defattr(-,root,root,755)
|
%defattr(-,root,root,755)
|
||||||
@ -1360,6 +1407,10 @@ popd
|
|||||||
%{libqt5_includedir}/QtPlatformCompositorSupport/%{so_version}/
|
%{libqt5_includedir}/QtPlatformCompositorSupport/%{so_version}/
|
||||||
%{libqt5_includedir}/QtServiceSupport/%{so_version}/
|
%{libqt5_includedir}/QtServiceSupport/%{so_version}/
|
||||||
%{libqt5_includedir}/QtThemeSupport/%{so_version}/
|
%{libqt5_includedir}/QtThemeSupport/%{so_version}/
|
||||||
|
%{libqt5_includedir}/QtEdidSupport/%{so_version}/
|
||||||
|
%if %{vulkan}
|
||||||
|
%{libqt5_includedir}/QtVulkanSupport/%{so_version}/
|
||||||
|
%endif
|
||||||
|
|
||||||
%files -n libQt5PrintSupport-private-headers-devel
|
%files -n libQt5PrintSupport-private-headers-devel
|
||||||
%defattr(-,root,root,755)
|
%defattr(-,root,root,755)
|
||||||
|
3
qtbase-everywhere-src-5.10.0.tar.xz
Normal file
3
qtbase-everywhere-src-5.10.0.tar.xz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:fd5578cd320a13617c12cf2b19439386b203d6d45548e855f94e07be9829f762
|
||||||
|
size 45851596
|
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:9e7c44005e7691dc7c85165bd4510282c47f0163521f4973eab71dbdb39a9982
|
|
||||||
size 45160080
|
|
@ -1,8 +1,8 @@
|
|||||||
diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf
|
Index: qtbase-everywhere-src-5.10.0-rc1/mkspecs/features/qt_module.prf
|
||||||
index f6cbf99..798472a 100644
|
===================================================================
|
||||||
--- a/mkspecs/features/qt_module.prf
|
--- qtbase-everywhere-src-5.10.0-rc1.orig/mkspecs/features/qt_module.prf
|
||||||
+++ b/mkspecs/features/qt_module.prf
|
+++ qtbase-everywhere-src-5.10.0-rc1/mkspecs/features/qt_module.prf
|
||||||
@@ -214,9 +214,9 @@ android: CONFIG += qt_android_deps no_linker_version_script
|
@@ -216,9 +216,9 @@ android: CONFIG += qt_android_deps no_li
|
||||||
QMAKE_LFLAGS += $${QMAKE_LFLAGS_VERSION_SCRIPT}$$verscript
|
QMAKE_LFLAGS += $${QMAKE_LFLAGS_VERSION_SCRIPT}$$verscript
|
||||||
|
|
||||||
internal_module {
|
internal_module {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user