Details
-
Bug
-
Resolution: Unresolved
-
P1: Critical
-
None
-
6.5
-
None
Description
QEvent::setAccepted(bool accepted) is a virtual function. This function is reimplemented by QPointerEvent to forward the 'accepted' state to all its event points.
The problem is that QEvent::accept() and ignore() are not virtual, and will simply toggle m_accept. This means that an event handler in Qt will function differently depending on if it chooses to accept() a mouse event, or use setAccepted(true). This is clearly wrong, and against the documentation for QEvent::accept().
In practice this means that even if an event handler chooses to ignore a mouse event, its event point might still be left accepted. And this will stop event propagation (1), which is agains the intention of ignoring the event.
1: QQuickDeliveryAgentPrivate::deliverPressOrReleaseEvent() checks if (event->allPointsAccepted()), and if so, stops propagation.
Attachments
Gerrit Reviews
For Gerrit Dashboard: QTBUG-123042 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
545795,3 | QCoreEvent: forward accept() to setAccepted(true) | dev | qt/qtbase | Status: NEW | -1 | 0 |