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

QMessageBox in mousePressEvent causes infinite loop (Mac)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3: Somewhat important
    • 5.15.6, 6.2
    • 5.2.1, 5.12.0 Beta 4
    • GUI: Drag and Drop
    • None
    • Mac OS X 10.7.4
    • macOS

    Description

      Derive a MainWidget from a QWidget, set is as central widget of a QMainWindow, and provide the following method:

      void MainWidget::mousePressEvent(QMouseEvent* pEvent) {
        QMessageBox::warning(this, "Title", "Hint");
      }
      

      Then,
      1. Click the RIGHT or MIDDLE mouse button inside the MainWidget (left button works fine)
      2. Close the appearing message box by CLICKING on the Ok button (closing per keyboard works)
      -> When you now move the mouse inside the MainWidget (without clicking), the message box re-appear, again and again as infinite loop.

      Also, if you close the message box in step 2 per keyboard, the message box doesn't appear again when you move the mouse, but if you press the right button again, it doesn NOT appear again, until you click a 3rd one.

      I can reproduce this on my Mac (OS X 10.7.4), but on Windows all works fine.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            tpochep Timur Pocheptsov
            chriskatze Christian Schauss
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes