PDA

View Full Version : QMessageBox without Icon in the title bar of my OS



klenze
11th November 2011, 17:59
Hi,

I use a QMessageBox in my Application. When the QMessageBox is displayed, a new Icon is shown in the title bar of my OS.
Regardless of the number of windows (MainWindow, QMessageBoxes, etc), I want to see one icon in my title bar only.
Is it posible to prevent this behavior?

Thanks.

klenze
23rd November 2011, 13:58
In the meantime I got a solution, which works perfect.

Calling a QMessageBox with its own parent, the messagebox is displayed in the center of the parent window and does not have its own title bar icon.

QMessageBox msg(this);
Otherwise it is possible to set the parent as follows:

msg.setParent(this);
msg.setWindowFlags(Qt::Dialog);
The function setParent(this) changes the window flags, so that the function setWindowFlags(flags) must be called.