PDA

View Full Version : QMessageBox::NoIcon



Mrdata
5th February 2007, 13:49
I want to display a Qmessagebox without any icons on it, so i used the following code but
it isn't working, and other settings aren't working too ( QMessageBox::Question, QMessageBox::Warning, etc) what am i doing wrong here? It always display the defaul icon no matter what i do



QMessageBox msgbox;

msgbox.question(this, tr("Info box"), "Info box text blabla", QMessageBox::Ok );
msgbox.setIcon( QMessageBox::NoIcon );

I also tried like this:

msgbox.question(this, tr("Info box"), "Info box text blabla", QMessageBox::NoIcon, QMessageBox::Ok );

wysota
5th February 2007, 13:57
QMessageBox::question is a static method - you can't control its icon. Use a non-static version instead.

QMessageBox msgbox(QMessageBox::NoIcon, "Info box", ...);
msgbox.exec();