Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.5.0 RC
-
None
Description
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:
- Start the example. Left side is a QWidget, right side is a QQuickWidget
- Click inside the QQuickWidget: cursor doesn't change, "contains: false" is printed to the console (unexpected)
- Make the QQuickWidget larger than the QWidget with the QSplitter
- 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
Attachments
Issue Links
- is required for
-
QTBUG-111927 Link hovering may not change cursor shape in web view
- Open
- relates to
-
QTBUG-110719 QQuickItem::setCursor() doesn't work in QGraphicsView without mouse event
- Reported