From bc632bc2bfe1a966bb187c20bb321d31fb8fe0b7 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Tue, 9 Jan 2018 12:19:44 +0100 Subject: QUnixPrintWidgetPrivate::_q_printerChanged: Update state correctly We need to update the printer output format and the current print device when changing the printer so that if the user opens the properties dialog for that printer it reflects correctly the selected printer. Change-Id: Ib6767a74b74b8eebe43ff17006b6105c483a08b6 Reviewed-by: Andy Shaw --- src/printsupport/dialogs/qprintdialog_unix.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/printsupport') diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp index d66a7f4be7..a3ba7be97d 100644 --- a/src/printsupport/dialogs/qprintdialog_unix.cpp +++ b/src/printsupport/dialogs/qprintdialog_unix.cpp @@ -915,14 +915,20 @@ void QUnixPrintWidgetPrivate::_q_printerChanged(int index) widget.lOutput->setEnabled(true); if (optionsPane) optionsPane->selectPrinter(QPrinter::PdfFormat); + printer->setOutputFormat(QPrinter::PdfFormat); + m_currentPrintDevice = QPrintDevice(); return; } } if (printer) { + printer->setOutputFormat(QPrinter::NativeFormat); + QPlatformPrinterSupport *ps = QPlatformPrinterSupportPlugin::get(); if (ps) m_currentPrintDevice = ps->createPrintDevice(widget.printers->itemText(index)); + else + m_currentPrintDevice = QPrintDevice(); printer->setPrinterName(m_currentPrintDevice.id()); -- cgit v1.2.3