diff --git a/src/printsupport/kernel/qplatformprintersupport_qpa.cpp b/src/printsupport/kernel/qplatformprintersupport_qpa.cpp index 35441df5fc3..d2459dc91d5 100644 --- a/src/printsupport/kernel/qplatformprintersupport_qpa.cpp +++ b/src/printsupport/kernel/qplatformprintersupport_qpa.cpp @@ -94,7 +94,7 @@ QPrinterInfo QPlatformPrinterSupport::defaultPrinter() if (printerInfo.isDefault()) return printerInfo; } - return printers.isEmpty() ? QPrinterInfo() : printers.front(); + return QPrinterInfo(); } QPrinterInfo QPlatformPrinterSupport::printerInfo(const QString &printerName) diff --git a/src/printsupport/kernel/qprinterinfo.cpp b/src/printsupport/kernel/qprinterinfo.cpp index fbf2e4de33c..dc60d7a50fa 100644 --- a/src/printsupport/kernel/qprinterinfo.cpp +++ b/src/printsupport/kernel/qprinterinfo.cpp @@ -69,7 +69,12 @@ QPrinterInfoPrivate QPrinterInfoPrivate::shared_null; The return value should be checked using isNull() before being used, in case there is no default printer. + On some systems it is possible for there to be available printers + but none of them set to be the default printer. + \sa isNull() + \sa isDefault() + \sa availablePrinters() */ /*!