简体   繁体   中英

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?

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);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM