KGuiAddons and QGestures like tap/click-and-hold to open context menu?

René J.V. Bertin rjvbertin at gmail.com
Sun Mar 12 08:03:51 UTC 2017


Hello,

The other day I had to add a context menu to a widget (QPushbutton) defined in a .ui file and went a bit further when I realised it could be nice to be able to open such a menu without using a right-click or menu button. After all, not all platforms have a (physical) right mouse button or a menu key; Macs come to mind but also mobile devices.

The usual way to open the context menu on such platforms is click/tap-and-hold - I think that was actually introduced in an early Mac OS X version.

With Qt's TapAndHold gesture this is actually not difficult to implement at all, see
https://forum.qt.io/topic/46738/how-to-simulate-properly-an-long-click-on-the-mouse-on-a-button-updated-with-full-code/10#

Would this be an idea to add to a framework like KGuiAddons?

R.


More information about the Kde-frameworks-devel mailing list