-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.2.0, 6.2.1
-
None
-
macOS Catalina 10.14
macOS Big Sure 11.4
macOS Monterey 12.0.1
To achieve the native modal dialog look on macOS Big Sur and later we have to use the following code:
QPrinterDialog dialog; dialog.setParent(parent, Qt::sheet); dialog.setModality(Qt::ApplicationModal); dialog.show(); QEventLoop nestedLoop; QObject::connect(&dialog, &QDialog::finished, [&nestedLoop](...){ nestedLoop.exit(); }); nestedLoop.exec();
For QPrinterDialog this produces the expected outcome only if the system has any registered printers. If QPrinterInfo::availablePrinters() is empty the call to QPrinterDialog::show() results in an invisible printer dialog which still locks the application until the user presses ESC.
Using QPrinterDialog::exec() in the same constellations - no printers known to the system - opens the expected printer dialog. The problem seems to be with the implementation of qprinterdialog_mac.mm which does different things in exec() and show().