diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp index 2cc5bfbb8c..caab7867dc 100644 --- a/src/printsupport/dialogs/qprintdialog_unix.cpp +++ b/src/printsupport/dialogs/qprintdialog_unix.cpp @@ -403,6 +403,10 @@ QPrintPropertiesDialog::~QPrintPropertiesDialog() void QPrintPropertiesDialog::setupPrinter() const { +#if QT_CONFIG(cups) + QCUPSSupport::clearCupsOptions(m_printer); +#endif + widget.pageSetup->setupPrinter(); #if QT_CONFIG(cupsjobwidget) m_jobOptions->setupPrinter(); diff --git a/src/printsupport/kernel/qcups.cpp b/src/printsupport/kernel/qcups.cpp index be170ed619..7e8e1707b2 100644 --- a/src/printsupport/kernel/qcups.cpp +++ b/src/printsupport/kernel/qcups.cpp @@ -77,6 +77,11 @@ void QCUPSSupport::clearCupsOption(QPrinter *printer, const QString &option) } } +void QCUPSSupport::clearCupsOptions(QPrinter *printer) +{ + setCupsOptions(printer, QStringList()); +} + static inline QString jobHoldToString(const QCUPSSupport::JobHoldUntil jobHold, const QTime holdUntilTime) { switch (jobHold) { diff --git a/src/printsupport/kernel/qcups_p.h b/src/printsupport/kernel/qcups_p.h index da2b087d5b..9a71483bb9 100644 --- a/src/printsupport/kernel/qcups_p.h +++ b/src/printsupport/kernel/qcups_p.h @@ -132,6 +132,7 @@ public: static void setCupsOption(QPrinter *printer, const QString &option, const QString &value); static void clearCupsOption(QPrinter *printer, const QString &option); + static void clearCupsOptions(QPrinter *printer); static void setJobHold(QPrinter *printer, const JobHoldUntil jobHold = NoHold, const QTime &holdUntilTime = QTime()); static void setJobBilling(QPrinter *printer, const QString &jobBilling = QString());