Results 1 to 4 of 4

Thread: QMessageBox missing icon

  1. #1
    Join Date
    Apr 2008
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Question QMessageBox missing icon

    Hi,

    I'm brand new to Qt programming and of course to this forum. So, greetings one and all.

    I am simply trying to display a QMessageBox but the "standard" icon is not showing. In its place is the default Mac Application icon (a sheet of paper with a pencil, brush, and ruler forming an 'A' for those familiar with Mac OSX).

    Here is the very simple code snippet:
    Qt Code:
    1. QMessageBox::warning((QWidget *)0, "Test", "Testing");
    To copy to clipboard, switch view to plain text mode 

    I also tried this code to manually load the icon with the same result:
    Qt Code:
    1. qmbox.setIcon(QMessageBox::Warning);
    2. qmbox.setText("Testing");
    3. qmbox.exec();
    To copy to clipboard, switch view to plain text mode 
    However, if I change the code to use the "Critical" message icon (using either of the above 2 methods) the "Warning" message icon appears.

    QMessageBox::Question and QMessageBox::Information behave the same as QMessageBox::Warning ... ie: no standard message icon is display. QMessageBox::NoIcon works properly and does not display any icon.

    I am programming on Mac OSX using Qt 4.3.3

    TIA
    Last edited by jpn; 12th April 2008 at 12:42. Reason: missing [code] tags
    Zanth

  2. #2
    Join Date
    Apr 2008
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: QMessageBox missing icon

    Hello again,

    I just noticed that if I run the program from the command line using: -style Plastique , the icons now display properly as per their purpose (Info, Warning, etc).

    Perhaps there is a bug with Qt's Mac OSX native "Aqua" implementation?
    Zanth

  3. #3

    Default Re: QMessageBox missing icon

    Sorry to bump this thread, but I've recently run into the same problem as the original poster. Do anyone know if there's a workaround to get the icons to display properly on OSX? Changing the application style is not an option since (for some reason) the performance is really bad when using plastique.

    Thanks,
    /Christoffer

  4. #4
    Join Date
    May 2010
    Posts
    61
    Thanks
    2
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QMessageBox missing icon

    This issue is still present in Qt 4.6.2 used with MAC OS 10.5.8.
    Does anyone have an update on this?

    Personally, I do not believe it is a bug, but a wanted feature. Can anybody confirm this?

    Regards,
    Wladek
    One second is long, everything longer than two seconds is definitely too long.

Similar Threads

  1. Couple of questions: main window icon + toolbar icon
    By bpackard in forum Qt Programming
    Replies: 0
    Last Post: 20th March 2008, 20:03
  2. Mac application and the Dock Icon
    By sekelsenmat in forum Qt Programming
    Replies: 3
    Last Post: 26th September 2007, 11:23
  3. QMessageBox Icon Issue and How to add a dir to Qt Resources File
    By vishal.chauhan in forum Qt Programming
    Replies: 19
    Last Post: 25th March 2007, 01:13
  4. customize the Icon QMessageBox
    By QiT in forum Newbie
    Replies: 1
    Last Post: 26th August 2006, 11:40
  5. Missing action icons
    By ReilenBlaeyze in forum KDE Forum
    Replies: 4
    Last Post: 20th February 2006, 13:05

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.