-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.5.1
-
macOS 13.3.1, Apple M1 CPU or Intel CPU, XCode 14.3
-
-
2c458a822 (dev), 492569fb4 (6.5), 848c01716 (6.6)
Code
#include <QtWidgets> int main(int argc, char **argv) { qputenv("QT_LOGGING_RULES", "qt.qpa.dialogs=true;qt.qpa.window=true;"); QApplication app(argc, argv); QPushButton topLevel("Click me"); topLevel.resize(100, 50); topLevel.show(); QObject::connect(&topLevel, &QPushButton::clicked, &app, []{ QDialog dialog; dialog.setModal(true); // <-- (1) dialog.show(); qApp->processEvents(); // <-- (2) dialog.hide(); // <-- (3) QMessageBox::question(nullptr, "Title", "Message"); }); return app.exec(); }
Expected outcomes (Qt 6.5.1 on Windows; Qt 6.2.8 on macOS)
After clicking the button, the QMessageBox stays open and awaits user selection.
Actual outcomes (Qt 6.5.1 on macOS)
After clicking the button, the QMessageBox flashes on screen momentarily and disappears without waiting for user selection.
Notes
- We get the expected outcome if we comment out any one of the 3 lines with numbered comments.
- The customer also reports that the test app crashes in Debug mode with ASSERT failure in Q_UNREACHABLE(): "Q_UNREACHABLE was reached", file /Users/tetzlaff/Qt/Qt6.5/qtbase/src/plugins/platforms/cocoa/qcocoamessagedialog.mm, line 299 on macOS 12, Intel CPU. I am unable to reproduce this crash on macOS 13 (either Intel or ARM CPU)