-
Type:
Bug
-
Status: Closed
-
Priority:
P2: Important
-
Resolution: Done
-
Affects Version/s: 5.4.0
-
Fix Version/s: 5.5.0 Beta
-
Component/s: QPA
-
Labels:None
-
Platform/s:
-
Commits:34ec0713bb5a2bc12782ab17ceabfead37c4b584
This is a regression from Qt4
QGuiApplication::setWindowIcon does not change the dock icon on mac.
Testcase:
#include <QApplication> #include <QWidget> #include <QImage> #include <QIcon> int main(int argc, char **argv) { QApplication app(argc, argv); QImage i(32,32, QImage::Format_RGB32); i.fill(Qt::blue); QApplication::setWindowIcon(QIcon(QPixmap::fromImage(i))); QWidget w; w.show(); return app.exec(); }
According to the apple documentation https://developer.apple.com/library/mac/documentation/Carbon/Conceptual/customizing_docktile/docktasks_cocoa/docktasks_cocoa.html one need to call [NSApp setApplicationIconImage] to update the dock icon.
Qt4 did that by qt_mac_set_app_icon calling in QApplication::setWindowIcon http://code.woboq.org/kde/qt4/src/gui/kernel/qapplication.cpp.html#2125
The implementation of qt_mac_set_app_icon
http://code.woboq.org/kde/qt4/src/gui/kernel/qapplication_mac.mm.html#471
In qt5 however, git grep setApplicationIconImage returns no results, and even Q(Gui)ApplicationPrivate::notifyWindowIconChanged does not notify the platform plugin that the icon has changed.
- is related to
-
QTBUG-37509 Linux: Regression in QApplication::setWindowIcon
-
- Closed
-
- replaces
-
QTBUG-27175 QApplication::setWindowIcon does not work
-
- Closed
-