View Full Version : Hiding MessageBox window icon

11th February 2011, 21:54
I`ve got one small question, about MessageBox, especially about property setWindowIson(). I would like to know if there is a possibility to hide this icon that appears in this MessageBox?

11th February 2011, 22:27
Maybe QMessageBox::NoIcon ?

11th February 2011, 23:13
No this icon. I mean the icon in title bar. Next to title of a messagebox

12th February 2011, 11:37
Can anyone help me?

12th February 2011, 15:51
If you do not need the system icons, you could try something like

QMessageBox m(parent);
m.setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint);

Alternatively, you could create a completely transparent icon and assign it to the message box object


This has the drawback that the dialog title still is shown at its original position, i.e. it is not shown at the left border.

Your question is not specific to QMessageBox. It applies to QDialog equally. Searching the WEB for "hiding icon on QDialog title bar" or something similar will show you some platform specific solutions.