I found that this problem is a windows manager problem rather than just Qt. The windows manager handles all windows, but your application can only affect its own windows. My project focuses on X11, where I always found "Qt::WindowStaysOnTopHint" was a hint only, and ignored by the windows manager. I was able to control the windows of my own application to assure that an important one stayed on top of others in the application, but even this was roundabout. I added an eventFilter on all widgets with actions that might cause the windows manager to raise a window to the top. If the event was something like "MouseButtonRelease", I'd queue another event to check on the window layering. When Qt and the windows manager are all done, my new event comes up and I simply "raise" the window I want on top. (If anyone has simpler ideas, I'd love to hear.) Now if you want to keep your application window on top of windows that are not part of your application, I don't know what to do with that!
- Dick
Bookmarks