Fix unix QPrintDialog initially selected printer
Unix QPrintDialog always set default printer as selected printer even though something was explicitly requested. [ChangeLog][QtPrintSupport][QPrintDialog] Properly pre-select explicitly requested printer on Unix. Task-number: QTBUG-63933 Change-Id: I6289f759d480b4891f4ddd7ff5aad3ae9ab4bc75 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit is contained in:
parent
60dfd59a60
commit
b764c4d0aa
@ -675,7 +675,9 @@ QUnixPrintWidgetPrivate::QUnixPrintWidgetPrivate(QUnixPrintWidget *p, QPrinter *
|
||||
|
||||
widget.printers->addItems(printers);
|
||||
|
||||
const int idx = printers.indexOf(defaultPrinter);
|
||||
const QString selectedPrinter = prn && !prn->printerName().isEmpty() ? prn->printerName() : defaultPrinter;
|
||||
const int idx = printers.indexOf(selectedPrinter);
|
||||
|
||||
if (idx >= 0)
|
||||
currentPrinterIndex = idx;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user