Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.0.0 RC2
-
None
Description
QKeyEvent::modifiers() shadows QInputEvent::modifiers(), but it's not virtual. It could be a proper virtual override.
We intended to remove all non-user-facing setters, but QInputEvent still has public setModifiers() and setTimestamp(), and QPointerEvent overrides setTimestamp(). These should either be private (accessible to friends only) or moved to QMutable*Event classes; but we don't have a QMutableInputEvent.
QPointerEvent::setAccepted() is a virtual override that sets the QEventPoint accepted state in the same way, so that legacy code that accepts an entire event is compatible with delivery code in QQuickWindow that is checking whether each point is accepted. But QEvent::accept() and ignore() are not virtual and do not do that. It's inconsistent, but fixing it would pessimize the implementation, so maybe we should just live with that one. (I suspect the whole reason that accept() and ignore() exist is that the implementation only takes one instruction, even if m_accept is in a bitfield: much more efficient than setAccepted() could be. But now m_accept is no longer in a bitfield. We have a tradition of thrashing this flag back and forth a lot during delivery: set it to true before visiting an item or widget, then the item or widget sets it back to false again, and usually there are more of them to visit after that.)
Attachments
Issue Links
- is required for
-
QTBUG-89157 Binary/Source incompatible changes to consider within Qt 6
- Open
-
QTBUG-69422 Input Handling Changes in Qt 6
- Closed
- replaces
-
QTBUG-72173 Refactor the QEvent hierarchy to make input events more like QQuickPointerEvents in Qt 6
- Closed