Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.4.2, 5.5.0
-
None
-
I have tested this on Mac OS 10.10.3 and Windows 7 with the same result.
-
others for 5.7; 5.12 on Windows: 8ada0633cd58e0608df2e16880f1293286025504; b4b706d454b785aecbec5cefe46e2a6d7572edbf
Description
In a QWidget derived class object with implemented tabletEvent(QTabletEvent *event) and mousePressEvent(QMouseEvent *event), the mousePressEvent gets called every time tabletEvent gets called with type QTabletEvent::TabletPress. According to the Qt documentation, this should not happen:
"The event handler QWidget::tabletEvent() receives TabletPress, TabletRelease and TabletMove events. Qt will first send a tablet event, then if it is not accepted by any widget, it will send a mouse event."
Here are the mousePressEvent() and tabletEvent() functions of the attached example project:
void TabletWidget::tabletEvent(QTabletEvent *event)
{ event->accept(); qDebug() << "tabletEvent: " << event->type(); }void TabletWidget::mousePressEvent(QMouseEvent *event)
{ qDebug() << "mousePressEvent"; }The output generated if I press any button of the Wacom Intuos CTH-680S-DEIT is:
tabletEvent: 92
mousePressEvent
tabletEvent: 87
tabletEvent: 87
tabletEvent: 87
tabletEvent: 87
tabletEvent: 93
So first the tabletEvent gets called, and even though I accept the event, mousePressEvent gets called anyway. Every following tabletEvent is of type QTabletEvent::TabletMove and the last one is QTabletEvent::TabletRelease. From the Qt documentation:
QEvent::TabletMove 87
QEvent::TabletPress 92
QEvent::TabletRelease 93
I have tested this on Mac OS 10.10.3 and Windows 7 with the same result.
Attachments
Issue Links
- relates to
-
QTBUG-26116 Support proximity motion
- Closed
-
QTBUG-100788 TapHandler tapped signal is emitted twice when using a stylus
- Closed
-
QTBUG-38681 WinRT: Pen input should be synthesized to mouse input
- Closed
-
QTBUG-59214 Wacom: it seems tabletEvent() by deault accepting it.
- Closed
-
QTBUG-67032 Mouse Wheel event gets propagated even when event filter should stop it
- Closed
-
QTBUG-93486 Clean up delivery logic of QContextMenuEvent
- Reported
- resulted in
-
QTBUG-129998 synthesis of mouse events after unaccepted QTabletEvents doesn't work on some platforms
- Reported
-
QTBUG-51617 QMouseEvent::source() reports MouseEventNotSynthesized when it comes from a Wacom tablet
- Closed
For Gerrit Dashboard: QTBUG-47007 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
257021,2 | Ensure that QTabletEvent is not pre-accepted before sending | dev | qt/qtbase | Status: NEW | 0 | 0 |
329334,4 | windows: don't do tablet->mouse synth; inform QGuiApplication | dev | qt/qtbase | Status: NEW | -1 | 0 |
153650,2 | deliver QTabletEvent synchronously; xcb: don't synth mouse if accepted | 5.7 | qt/qtbase | Status: ABANDONED | -1 | 0 |
155046,4 | add cross-platform tablet->mouse event synth; enable on Android | 5.7 | qt/qtbase | Status: MERGED | +2 | 0 |
155176,3 | xcb: remove tablet->mouse event synth; harmonize handle/report methods | 5.7 | qt/qtbase | Status: MERGED | +2 | 0 |
155179,4 | OSX: remove tablet->mouse event synth | 5.7 | qt/qtbase | Status: MERGED | +2 | 0 |
172342,9 | Cocoa: Don’t send tablet events as mouse events | 5.7 | qt/qtbase | Status: MERGED | +2 | 0 |
238456,2 | Windows QPA: Stop synthesizing mouse events from tablet/touch | 5.12 | qt/qtbase | Status: MERGED | +2 | 0 |
239918,3 | Ensure that QTabletEvent is not pre-accepted before sending | 5.12 | qt/qtbase | Status: MERGED | +2 | 0 |