[Interest] [ OS X ] QGraphicsScene right-mouse click does not set app focus?

Eddie Sutton edsutton at gmail.com
Tue Mar 31 20:59:05 CEST 2015


Question: How can I make my app set focus when user right mouse clicks over the QGraphicsScene?


My QMainWindow central widget contains a QGraphicsScene.

1 - If I click the title bar of the window, the app takes focus
2 - When I right-mouse click in the QGraphicsScene, the context menu pops up, stays put, and allows user to select a menu item.  All good.


1 - If I click on the desktop, the app no longer has focus
2 - When I right-mouse click in the QGraphicsScene, the context menu pops up, and disappears as soon as I release the right mouse button. The window title bar stays light-gray indicating app does not have focus.

/// Displays context menu at mouse coordinates of scene
void Scene::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)

Thanks in advance,

-Ed




More information about the Interest mailing list