Details
-
Task
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.0.0
-
None
Description
There is some old code in android/androidjniinput.cpp which should theoretically make a long press on a touchscreen turn into a right click if the env var QT_NECESSITAS_COMPATIBILITY_LONG_PRESS is set.
We have had proposals to add this feature to other platforms: https://codereview.qt-project.org/c/qt/qtbase/+/270852 https://codereview.qt-project.org/c/qt/qtbase/+/288906
One idea is to handle long press more or less the same as we handle double-clicks: send a special long press event, by having a timer in qtgui somewhere. The time interval could be configurable in QStyleHints alongside mouseDoubleClickInterval etc. But this idea is based on the assumption that we have to do this ourselves. Maybe some platforms can already do it, and maybe that's better or more efficient.
If we're going to do it in platform plugins, we ought to at least have consistent API to turn the feature on or off. An application attribute or something.
TapHandler currently does its own long-press detection. The downside is needing a timer in every TapHandler. The upside is that the time is configurable in every use case, whereas a shared timer in QtGui would have to be the same throughout an application. Then we have to think about whether to deprecate that longPressThreshold property: https://doc.qt.io/qt-5/qml-qtquick-taphandler.html#longPressThreshold-prop
Adding a long-press event is one thing. But from those patch proposals it seems some users want legacy applications to "just work" on touchscreens, so they want it to turn into a right click. So maybe we need another application attribute for that, or something.
Attachments
Issue Links
- is duplicated by
-
QTBUG-96770 Qt should provide right click emulation for pen input on non Windows platforms
- Reported
- is required for
-
QTBUG-73949 Qt should provide some right click emulation for touchscreen on non Windows platforms.
- Reported
-
QTBUG-73063 Qt Quick Changes in Qt 6
- Open
-
QTBUG-77902 MouseArea does not get fake right click on touchscreen
- Closed
-
QTBUG-68075 DragHandler: need the ability to start dragging after a long press
- Reported
- relates to
-
QTBUG-31331 Long press interferes with MouseArea on Android
- Closed
-
QTBUG-36162 A long press does not call a right click event when "Enable press and hold for right-clicking" in the Pen and Touch settings is enabled
- Closed
-
QTBUG-73416 [Android]: When doing a long press to show a context menu, it is not showing the menu at all
- Closed
-
QTBUG-14921 Hope to add a long pressed signal in QListWidget
- Closed
Gerrit Reviews
For Gerrit Dashboard: QTBUG-84179 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
370529,4 | Add an attribute for right-click synthesis from unhandled touch events | dev | qt/qtbase | Status: NEW | -1 | 0 |
303023,9 | Android: fix behovior of right click to not interfere with other clicks | dev | qt/qtbase | Status: MERGED | +2 | 0 |
303935,2 | Android: fix behovior of right click to not interfere with other clicks | 5.15 | qt/qtbase | Status: MERGED | +2 | 0 |
439510,6 | Allow OS-synthesized right clicks to be delivered | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |