PDA

View Full Version : QMessageBox missing icon



zanth
12th April 2008, 06:35
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:

QMessageBox::warning((QWidget *)0, "Test", "Testing");

I also tried this code to manually load the icon with the same result:


QMessageBox qmbox;
qmbox.setIcon(QMessageBox::Warning);
qmbox.setText("Testing");
qmbox.exec();

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

zanth
12th April 2008, 06:59
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?

christoffer
19th December 2008, 20:47
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

wladek
8th July 2010, 21:20
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