开发者

Receive events when QCustomContextMenu is open

I have an issue capturing the key and mouse events. I have a class which inherits QGLWidget. I invoke a context menu QCustomContextMenu by setting the context menu policy of the widget. As the context menu is open, I am unable to capture the mouse and key events. I will need the events to be captured even when the context m开发者_开发问答enu is open.

Thanks!


i believe you have heard about the installEventFilter.

you have to install the event filter for the object you want events to be received (e.g Contextmenu).

install event filter, and create event filter method to handle event in a way you want.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜