path: root/examples/widgets/statemachine/rogue
diff options
authorTor Arne Vestbø <>2017-11-06 14:52:13 +0100
committerTor Arne Vestbø <>2017-11-07 14:39:12 +0000
commit59c5f7bd9da63621887260fc45e6669282d71ecd (patch)
tree2a549a254b90e4b582b6bccf43deb5a2bce86541 /examples/widgets/statemachine/rogue
parent28c1e17aef520abfa051c7d9a9fe0f45ec6a5db8 (diff)
macOS: Fall back to QWindow::icon for application icon if not set
There are three ways to set the application (Dock/task switcher) icon: 1. By setting an ICON in the project file 2. By calling QGuiApplication::setWindowIcon 3. By calling QWindow::setIcon The third one was not working on macOS, despite being documented as such: "The window icon might be used by the windowing system for example to decorate the window, and/or in the task switcher." We now update the application icon based on the active window, unless a global application icon has been set using ICON, or via QGuiApplication::setWindowIcon. The reason for not allowing the window's icon to override a global application icon is that the developer may have intended to set the document icon for a window (to represent QWindow::filePath), and we don't want that to affect the Dock icon of the application. The role of QGuiApplication::setWindowIcon is a bit dubious in this, as it's documented as "This property holds the default window icon", which would indicate it should follow the same logic as above by not letting it override the global ICON set in the project file, but this would not allow runtime switching of the application icon, so the QGuiApplication property is left as is. The property should probably have been named QGuiApplication::applicationIcon initially. Task-number: QTBUG-63340 Change-Id: I94d3710a8586bb729af42f59a915b8f49dded101 Reviewed-by: Morten Johan Sørvig <>
Diffstat (limited to 'examples/widgets/statemachine/rogue')
0 files changed, 0 insertions, 0 deletions