Qt_mac_set_dock_menu not working
-
Hello everybody!
I'm developing app for mac and I want change dock icon. I'm using this in construct of MainWindow:
QMenu *menu = new QMenu();
menu->setIcon(QIcon("/Users/karelhladky/battery-1.icns"));
extern void qt_mac_set_dock_menu(QMenu *);
qt_mac_set_dock_menu(menu);but nothing happens. Even if I use resource icon instead full path. By the way I download this icon http://www.iconseeker.com/search-icon/blankon/battery-1.html
-
Well, I finally find out where was the problem - using icns files. PNG icons works perfectly :-)
-
Hi,
IIRC icns files are use for the bundle icon (ICON += battery-1.icns in your pro file, and as value for CFBundleIconFile in your Info.plist)
If you want to know what format you can use for QIcon you can use "QImageRead::supportedImageFormats":http://qt-project.org/doc/qt-4.8/qimagereader.html#supportedImageFormats
If you really want to use icns files for icon, you will have to write your own QImageIOPluging.
Hope you find this useful :)
-
thanks! PNG icons are enough :)