diff options
author | Albert Astals Cid <[email protected]> | 2018-01-09 12:19:44 +0100 |
---|---|---|
committer | Albert Astals Cid <[email protected]> | 2018-01-09 15:42:25 +0000 |
commit | bc632bc2bfe1a966bb187c20bb321d31fb8fe0b7 (patch) | |
tree | bc708dbbc6c6beb3e1c11b746403298071e7e730 /src/printsupport/dialogs/qprintdialog_unix.cpp | |
parent | f6fd3f18d301cde311420bfffeb027b40e33dafb (diff) |
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 <[email protected]>
Diffstat (limited to 'src/printsupport/dialogs/qprintdialog_unix.cpp')
-rw-r--r-- | src/printsupport/dialogs/qprintdialog_unix.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp index d66a7f4be79..a3ba7be97d0 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()); |