Results 1 to 2 of 2

Thread: QMessageBox::NoIcon

  1. #1
    Join Date
    Feb 2007
    Posts
    39
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Windows

    Default QMessageBox::NoIcon

    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 );

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QMessageBox::NoIcon

    QMessageBox::question is a static method - you can't control its icon. Use a non-static version instead.
    Qt Code:
    1. QMessageBox msgbox(QMessageBox::NoIcon, "Info box", ...);
    2. msgbox.exec();
    To copy to clipboard, switch view to plain text mode 

  3. The following user says thank you to wysota for this useful post:

    Mrdata (5th February 2007)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.