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

QEventPoint::scenePosition is not reliable for QQuickWidget

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 6.5.0 RC
    • Quick: Widget
    • None
    • All

      If the QQuickWidget is smaller than the main window, the scenePosition of the QEventPoint triggered by a mouse event above the QQuickWidget may have a value out of the QQuickWidget. If the QQuickWidget has the same size as the main window everything works as expected.

      To demonstrate this, I have attached an example ( quickwidget-hittest.tgz ) wherein a QQuickWidget is in a QSplitter with a QWidget. If the QQuickWidget is smaller than half of the window, scenePosition is out of QQuickWidget. See the comments in the example code.

      Steps to reproduce:

      1. Start the example. Left side is a QWidget, right side is a QQuickWidget
      2. Click inside the QQuickWidget: cursor doesn't change, "contains: false" is printed to the console (unexpected)
      3. Make the QQuickWidget larger than the QWidget with the QSplitter
      4. Click inside the QQuickWidget: cursor changes, "contains: true" is printed to the console (expected)

      This use-case is inspired by another issue reported for QtWebEngine: https://bugreports.qt.io/browse/QTBUG-111927
      The example tries to mimic QtWebEngine behavior as simple as possible. This issue is very similar to another issue with QQuickWidget inside a QGraphicsView: https://bugreports.qt.io/browse/QTBUG-110719

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

            srutledg Shawn Rutledge
            pvarga Peter Varga
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes