PDA

View Full Version : QMessageBox icon



penny
8th April 2011, 11:30
I have a QMessageBox,

MessageBox loadMsgBox;
loadMsgBox.setText("Loading file...");
loadMsgBox.setWindowTitle(" ");
loadMsgBox.setIconPixmap(QPixmap("./icons/icon_loading.gif"));
loadMsgBox.exec();

I want to set the main icon on the title bar, by default it shows a white rectangle. How do i change that?

jwjoshua
8th April 2011, 11:39
Hi
Use setWindowIcon();

example:


loadMsgBox.setWindowIcon(QIcon(QPixmap("./icons/ico.png")));