The QMessageBox class provides a modal dialog for informing the user or for asking the user a question and receiving an answer. QMessageBox supports four predefined message severity levels, or message types, which really only differ in the predefined icon they each show. Specify one of the four predefined message types by setting the icon property to one of the predefined icons. The following rules are guidelines:
We can modified QMessagebox icon by use either setIcon() for one of the standard icons, or setIconPixmap() for a custom icon. This is a method how to QMessageBox change icon example. From this QMessageBox change icon code, I use setIconPixmap() method with input a png icon file. This is a screenshoot from default QMessageBox window and QMessageBox change icon window :
QMessageBox mb("Show Messagebox",
"QMessageBox with new Icon?",
QMessageBox::Yes | QMessageBox::Default,
You can download the complete change QMessageBox Icon source code at here.Source : http://www.qtcentre.org/threads/3430-customize-the-Icon-QMessageBox
My name is Toto Sugito. This is my notes when I try something. Maybe, this is NOT THE BEST SOLUTION for your problems. If you have other method or idea that better with my post, please share in this blog. Thank for visiting my site.