Hello!

The software I'm currently developing needs to, from time to time, show its MainWindow form in a way that it stays on top over all other running applications in Windows, but I couldn't find how to do this.

I heard that "this->raise()" only works with windows of the application itself, and "Qt::WindowStaysOnTopHint" works for QWidget, but not QMainWindow.

Interesting to notice that I'm using showFullScreen() for the MainWindow, but that don't do what I want exactly: it covers the area (including the taskbar) correctly, but if a software is opened, it appears over the MainWindow form, and that's what I don want.

If the analogy is usefull, what I want is exactly equal to the Borland C++ Builder function:

Qt Code:
  1. Form->FormStyle = fsStayOnTop;
To copy to clipboard, switch view to plain text mode 

What happens with this code is that the window stay on top doesn't matter which other window you work with or other software you open.



Thanks!

Momergil