0

I have a basic QDialog with it's WindowFlags set to Qt::Popup so that it appears as a typical popup overlay. On Windows, everything works great and if you click outside the main window or really anywhere else it goes away. But on Mac OSX, if you click the menu bar at the top or resize the window, the popup just stays where it is. I have absolutely no internal handling of the mouse enter/leave/move/press events for the popup, so the closing of it is not something I'm even handling... it's just automatic on Windows.

Any idea I can get it to close when the main application is no longer the current context on the system?

Adam Haile
  • 30,705
  • 58
  • 191
  • 286
  • It hides properly for me when the parent window loses focus. Though not when resizing or clicking on the title bar. Is that what you mean? – jdi Oct 13 '12 at 16:05

1 Answers1

0

You may install native event filter and to close active popup dialog (QApplication::activePopupWidget()) when user will click out of main window. See the following answer for information how to install native filter.

Community
  • 1
  • 1
nomenas
  • 111
  • 3