Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
6.2.2, 6.3.0 Alpha
-
None
-
-
0f85202699 (qt/qtdeclarative/dev) 25ab62cce5 (qt/qtdeclarative/6.4) 25ab62cce5 (qt/tqtc-qtdeclarative/6.4) 0f85202699 (qt/tqtc-qtdeclarative/dev) 25ab62cce5 (qt/qtdeclarative/6.4.1)
Description
The following example prints "TAP" on right clicks until Qt 5.15.2.
With Qt 6.2 / 6.3 this stops working (haven't tried Qt 6.0/6.1).
Motivation for intercepting a right click is to show a desktop text context menu (Cut/Copy/Paste) which (unfortunately) is still not available out-of-the box with TextField/TextArea.
import QtQuick 2.15 import QtQuick.Controls 2.15 import QtQuick.Window 2.15 Window { width: 640 height: 480 visible: true title: qsTr("Hello World") TextField { anchors.centerIn: parent width: 200 text: "Hello" selectByMouse: true TapHandler { acceptedButtons: Qt.RightButton acceptedDevices: PointerDevice.Mouse onTapped: { console.log("TAP") } } } }
Attachments
Issue Links
- is duplicated by
-
QTBUG-105609 should be able to add a TapHandler to a Button to modify behavior
- Closed
- relates to
-
QTBUG-66535 TextField/TextArea mouse cursor
- Closed
-
QTBUG-35598 QtQuick Controls TextField and TextArea miss mouse context menu
- Open
-
QTBUG-67331 Make it possible to react to context menu events
- Open
- resulted from
-
QTBUG-94012 handlers in underlying or parent items should be able to avoid reacting when a higher-z or child item already handled it
- Closed