[Qt-interest] Popup window without stealing focus

Jason Wood jwood275 at googlemail.com
Tue Feb 23 13:22:37 CET 2010


Hi,

I have a QMainWindow which is a small popup (like a Growl notification
window), which I set the following in the constructor:

this->setWindowFlags(Qt::WindowStaysOnTopHint | Qt::Tool);

this->setFocusPolicy(Qt::NoFocus);

this->setAttribute(Qt::WA_ShowWithoutActivating);


But it always steals focus when I call .show() on the window. Is there a way
to have it popup without stealing the focus? My application lives in the
background (UIElement set to true in Info.plist) and has no main window by
default, perhaps the problem is the application coming to front rather than
the window? The window does not seem to be focussed but the currently
selected window in Finder or other application loses focus when it displays.


Does anyone have any tips to get round this?


Thanks,


Jason.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100223/b526f2d0/attachment.html 


More information about the Qt-interest-old mailing list