[Interest] TapAndHoldGesture finishes (triggers) with no mouse buttons pressed?

René J.V. Bertin rjvbertin at gmail.com
Thu Aug 3 18:43:02 CEST 2017


I'm using the Qt::TapAndHoldGesture to implement a click-and-hold-opens-contextmenu feature (https://github.com/RJVB/osx-integration/blob/qt590/src/platformtheme/kdemactheme.mm#L164).

This mostly works fine but there are cases where I get the context menu even when I'm no longer holding the left mouse button. A notable example is when I single-click a QToolButton that has a menu. As long as the menu is open my own event filter doesn't receive MouseButtonRelease or MouseMove events (used to cancel the click-and-hold process), but apparently Qt's own Gesture processing fails to receive crucial events too. Why would a TapAndHold gesture signal it is finished (read: trigger) when no mouse button is being held?

Am I overlooking something which makes this NOT a bug?


PS: tested in Qt 5.8.0 .

More information about the Interest mailing list