-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
QWidgetWindow: send QContextMenuEvent even after accepted mouse press
It would be more consistent if we could rely on the accepted state of the original QMouseEvent to decide whether to follow up with a QContextMenuEvent; but not all Qt widgets call ignore() on unhandled mouse events, both in Qt and in external libraries and applications (including some from KDE). So we should at least wait until Qt 7 to make this a requirement. It seems sensible to move the check into QWindow::event() rather than trying to distinguish the window type in maybeSynthesizeContextMenuEvent(). We merely output a categorized log message to indicate when the legacy behavior is in effect. Amends 84a5f50 [ChangeLog][QtWidgets] If your QWidget subclass depends on receiving QContextMenuEvent, and also handles mouse events directly, we recommend that you call ignore() on unhandled mouse events (such as right-button events). In Qt 7, we plan to stop sending QContextMenuEvent if the triggering mouse event is accepted. Fixes: QTBUG-132066 Pick-to: 6.9 Change-Id: I454813dab4c387112f161fc28a0ee94570013afa Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
- Loading branch information
Showing
2 changed files
with
24 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters