Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.6.0
-
None
-
-
85f791791 (12.0), 7edff3f15 (dev), c967ee08c (6.7), 7c782dc20 (6.6), dcd6d6586 (tqtc/lts-6.5), fd1beb3e2 (6.6.2)
Description
My guess is that the regression is in Qt 6.5 too.
Run the following little application, click the "open dialogs" button, close the dialogs, and try focus a text edit by clicking or try to click the button again.
#include <QApplication> #include <QMessageBox> #include <QPlainTextEdit> #include <QPushButton> #include <QVBoxLayout> static void execMessage(const QString &text, QWidget *parent) { QMessageBox mBox(parent); mBox.setText(text); mBox.setStandardButtons(QMessageBox::No | QMessageBox::Yes); mBox.setDefaultButton(QMessageBox::Yes); mBox.exec(); } int main(int argc, char *argv[]) { QApplication a(argc, argv); QWidget w; w.setLayout(new QVBoxLayout); auto button = new QPushButton("Open Dialogs"); w.layout()->addWidget(new QPlainTextEdit); w.layout()->addWidget(new QPlainTextEdit); w.layout()->addWidget(button); QObject::connect(button, &QPushButton::clicked, &w, [&] { QMetaObject::invokeMethod( &w, [] { execMessage("second message", QApplication::activeModalWidget()); }, Qt::QueuedConnection); execMessage("first message", &w); }); w.show(); return a.exec(); }
Expected: Mouse interaction with the "application" is still possible
Actual: The application no longer reacts to mouse clicks (or moves). After switching applications away and back again, the previously focussed text edit regains keyboard focus and typing there is still possible, and changing focus with backtab works as well, but clicking with the mouse doesn't have any effect, and the "Quit messageboxes" menu item stays disabled as well (it is not possible to quit the application).