Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.6.2, 5.8.0, 5.9.0
-
41293196b4db1aa7a0c616af312875c484639644
Description
When using QML inside a QQuickWidget, synthetic mouse events are synthesized by the operating system, when sliding a finger over a touch device. According to the documentation those mouse events shoud be marked with MouseEventSynthesizedBySystem. This is currently not the case when those events arrive at the QQuickItem within the QML scene, thereby making it difficult to differentiate between real and synthesized mouse events.
Attached example reproduces it.
Run the example and touch and slide green area, you can find that QQuickWidget prints
MyQuickWidget::mousePressEvent QMouseEvent(MouseButtonPress, LeftButton,
localPos=72,143, screenPos=778,256, MouseEventSynthesizedBySystem)
Qt::MouseEventSource(MouseEventSynthesizedBySystem)
same even when passed to Quickitem it looses its source as it can be seen in
void QQuickWidget::mousePressEvent(QMouseEvent *e) that mapped event is not copying e-source()
MyQuickItem::mousePressEvent QMouseEvent(MouseButtonPress, LeftButton,
localPos=72,143, screenPos=778,256)
Qt::MouseEventSource(MouseEventNotSynthesized)
void QQuickWidget::mousePressEvent(QMouseEvent *e) { Q_D(QQuickWidget); Q_QUICK_INPUT_PROFILE(QQuickProfiler::Mouse, QQuickProfiler::InputMousePress, e->button(), e->buttons()); QMouseEvent mappedEvent(e->type(), e->localPos(), e->screenPos(), e->button(), e->buttons(), e->modifiers()); QCoreApplication::sendEvent(d->offscreenWindow, &mappedEvent); e->setAccepted(mappedEvent.isAccepted()); }
Attachments
Issue Links
- is duplicated by
-
QTBUG-57378 [Windows/QQuickWidget]: QQuickPaintedItem does not get a touchEvent() when touching the screen as it goes to straight to mousePressEvent()
- Closed
- resulted in
-
QTBUG-65800 QQuickWidget doesn't receive mouse events when not at topleft corner of window
- Closed
-
QTBUG-67018 [Regression] Virtual Keyboard no longer usable
- Closed