StrikeByte
21st May 2012, 16:21
Hello all,
I'm creating a virtual right mouse button, this is only used in the Qt application. Holding down the left mouse button for 750 msec it will send a ContextMenuEvent. This is usefull for touchscreen users, and not willing to enable global virtual right mouse button.
Now the real problem/challenge
I've made a VirtualRightMouseButton class which installs an eventfilter by using qApp->installEventFilter(...
When i hold the left mouse button on an editbox or some other editor it works perfectly (and opens a context menu), now when i use it on a label it doesn't show a context menu (yes i know it doesn't have a default context menu, so i added an customcontextmenu, when normal right clicking it, it works and shows the custom context menu)
after a while of debugging i found that the eventfilter gets the container class instead of the label (in this case the QMainWindow and not the QLabel) does anyone know why
Thanks in advance.
edit: It also works normally on QButtons
I'm creating a virtual right mouse button, this is only used in the Qt application. Holding down the left mouse button for 750 msec it will send a ContextMenuEvent. This is usefull for touchscreen users, and not willing to enable global virtual right mouse button.
Now the real problem/challenge
I've made a VirtualRightMouseButton class which installs an eventfilter by using qApp->installEventFilter(...
When i hold the left mouse button on an editbox or some other editor it works perfectly (and opens a context menu), now when i use it on a label it doesn't show a context menu (yes i know it doesn't have a default context menu, so i added an customcontextmenu, when normal right clicking it, it works and shows the custom context menu)
after a while of debugging i found that the eventfilter gets the container class instead of the label (in this case the QMainWindow and not the QLabel) does anyone know why
Thanks in advance.
edit: It also works normally on QButtons