Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.15.2
-
None
Description
I try open QPageSetupDialog, but if system does not have any printer, this dialog does not open and show this message: "QPageSetupDialog: Cannot be used on non-native printers"
I think this problem occurs because this dialog checks output format:
// qpagesetupdialog.cpp void QPageSetupDialogPrivate::setPrinter(QPrinter *newPrinter) { // ... if (printer->outputFormat() != QPrinter::NativeFormat) qWarning("QPageSetupDialog: Cannot be used on non-native printers"); }
but I cannot add this format because QPrinter ignore it if system doesn't have printers.
// qprinter.cpp void QPrinter::setOutputFormat(OutputFormat format) { Q_D(QPrinter); if (d->outputFormat == format) return; if (format == QPrinter::NativeFormat) { QPrinterInfo printerToUse = d->findValidPrinter(); if (!printerToUse.isNull()) d->changeEngines(format, printerToUse); } else { d->changeEngines(format, QPrinterInfo()); } }