How to display a QMessageBox on top of all windows

I created a program that works with the application in full screen mode. I would like the QMessageBox from my program to appear on top of an application that runs in full screen.

The platform is Windows 7 and I use Qt.

I tried:

QMessageBox *msgBox = new QMessageBox;
msgBox->setParent(0);
msgBox->setWindowTitle(title);
msgBox->setText(text);
msgBox->setWindowFlags(Qt::WindowStaysOnTopHint);
msgBox->show();

Bad luck. Any clues?

+4
source share
1 answer

msgBox->raise(); , setWindowFlags(Qt::WindowStaysOnTopHint);, (evtl. minim/restore). , os, "" , () .

+2

Source: https://habr.com/ru/post/1539531/


All Articles