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

QOpenGLWidget seems to mess up mouse events even though it is deleted

XMLWordPrintable

    • Windows

      Reproducer attached. It features a ParentWidget which does 2 things:
      1. Provide a button that you can interact with.
      2. Brings up a ChildWidget.
      Notice that the ChildWidget is set to be translucent, frameless and a window type. With that particular combination, it basically "hovers" over its parent and is transparent to mouse events too. And the result is that you can still interact with the underlying "Click parent" button even though the ChildWidget covers entire ParentWidget. That is the desired behavior.

      Then click the "Cause the problem" button. It will create a QOpenGLWidget and immediately delete it. But the problem is that you can no longer interact with "Click parent" button anymore. Even though the QOpenGLWidget is as good as never existed, the mouse event handling is permanently messed up.

      I install an event filter for debugging too. So before QOpenGLWidget was created, the mouse events are delivered to QPushButton. But after the construction and destruction, ChildWidget intercepts the mouse events. That explains why the "Click parent" button is no longer working. But I don't know why creating and deleting a QOpenGLWidget can cause that.

      The problem does not occur if it is a plain QWidget instead of a QOpenGLWidget. That means it is something specific to QOpenGLWidget rather than generic event handling.

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

            axelspoerl Axel Spoerl
            luqiaochen Luqiao Chen
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes