Nocta
Nocta

Reputation: 309

Window on top of another window?

I want one window to stay above my MainWindow so I use this->setWindowFlags(Qt::WindowStaysOnTopHint); This makes the window stay on top of EVERY window (also from other applications). Also it is above QMessageBox Windows and blocks them. I want them to appear on top of that window.

How can I do that?

Upvotes: 1

Views: 781

Answers (1)

Nejat
Nejat

Reputation: 32685

You don't need to set WindowStaysOnTopHint flag to force your dialog stay on top of main window. Just set main window as the parent of the dialog when instantiating it in the constructor of main window like :

dialog = new MyDialog(this);

Upvotes: 2

Related Questions