Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-130696

Crash on utilizing a message box while handling a focus out event

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.8.0, 6.9
    • GUI: Menus
    • None
    • Windows
    • 99ff48ce4 (15.0)

    Description

      Minimal Example:

      #include <QApplication>
      #include <QMainWindow>
      #include <QMenuBar>
      #include <QMessageBox>
      #include <QPlainTextEdit>
      
      class TextEdit : public QPlainTextEdit
      {
      public:
          void focusOutEvent(QFocusEvent *event) override { QMessageBox::question(this, "Save", "Save"); }
      };
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          QMainWindow w;
          w.show();
          w.menuBar()->addMenu("Foo")->addAction("Bar");
          auto te = new TextEdit();
          w.setCentralWidget(te);
      
          return a.exec();
      }
      

      Results in a crash with this Backtrace1.txt

      It looks like the QAlphaWidget gets deleted during the execution of QAlphaWidget::run.

      The issue can be worked around by calling:

      QApplication::setEffectEnabled(Qt::UI_FadeMenu, false);
      

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-130696
          # Subject Branch Project Status CR V

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              davschul David Schulz
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes