Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.4.0
-
None
-
-
34ec0713bb5a2bc12782ab17ceabfead37c4b584
Description
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.
Attachments
Issue Links
- relates to
-
QTBUG-37509 Linux: Regression in QApplication::setWindowIcon
-
- Closed
-
- replaces
-
QTBUG-27175 QApplication::setWindowIcon does not work
-
- Closed
-