summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Portale <alessandro.portale@theqtcompany.com>2016-05-04 16:14:39 +0200
committerTim Jenssen <tim.jenssen@theqtcompany.com>2016-05-13 11:59:20 +0000
commit6ef8d67413511f07abb4f71593ed6d8567f61ca8 (patch)
treec874c31442f1f323eee749084cbb3c3698b1a106
parent27bced7694a593eca555bf4cc46c084ba9302f2d (diff)
downloadqttools-6ef8d67413511f07abb4f71593ed6d8567f61ca8.tar.gz
Do not unnecessarily set the window icons on Windows
Applications which have an .ico file in their (MS) resources will have their icon displayed just fine in the window title, task bar, task switcher, etc. These .ico files contain all resolutions which are needed by Windows. There is no need to re-set that icon from a ".png" file at runtime, which usually also implies scaling it. Change-Id: Iee6e141637bd5b8ccb677adae115eb84dd2dafa4 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
-rw-r--r--src/assistant/assistant/mainwindow.cpp5
-rw-r--r--src/designer/src/designer/qdesigner.cpp2
-rw-r--r--src/linguist/linguist/mainwindow.cpp2
-rw-r--r--src/qdbus/qdbusviewer/main.cpp5
4 files changed, 9 insertions, 5 deletions
diff --git a/src/assistant/assistant/mainwindow.cpp b/src/assistant/assistant/mainwindow.cpp
index 48f9d948f..999179fa1 100644
--- a/src/assistant/assistant/mainwindow.cpp
+++ b/src/assistant/assistant/mainwindow.cpp
@@ -197,10 +197,13 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent)
appIcon.addPixmap(pix);
} while (reader.jumpToNextImage());
qApp->setWindowIcon(appIcon);
- } else {
+ }
+#if !defined(Q_OS_OSX) && !defined(Q_OS_WIN)
+ else {
QIcon appIcon(QLatin1String(":/qt-project.org/assistant/images/assistant-128.png"));
qApp->setWindowIcon(appIcon);
}
+#endif
QToolBar *toolBar = addToolBar(tr("Bookmark Toolbar"));
toolBar->setObjectName(QLatin1String("Bookmark Toolbar"));
diff --git a/src/designer/src/designer/qdesigner.cpp b/src/designer/src/designer/qdesigner.cpp
index 23f35f2d7..59c986e72 100644
--- a/src/designer/src/designer/qdesigner.cpp
+++ b/src/designer/src/designer/qdesigner.cpp
@@ -88,7 +88,7 @@ QDesigner::QDesigner(int &argc, char **argv)
setApplicationName(QLatin1String(designerApplicationName));
QDesignerComponents::initializeResources();
-#ifndef Q_OS_MAC
+#if !defined(Q_OS_OSX) && !defined(Q_OS_WIN)
setWindowIcon(QIcon(QStringLiteral(":/qt-project.org/designer/images/designer.png")));
#endif
}
diff --git a/src/linguist/linguist/mainwindow.cpp b/src/linguist/linguist/mainwindow.cpp
index 20a6a0fdf..d4f522d0d 100644
--- a/src/linguist/linguist/mainwindow.cpp
+++ b/src/linguist/linguist/mainwindow.cpp
@@ -270,7 +270,7 @@ MainWindow::MainWindow()
setUnifiedTitleAndToolBarOnMac(true);
m_ui.setupUi(this);
-#ifndef Q_OS_MAC
+#if !defined(Q_OS_OSX) && !defined(Q_OS_WIN)
setWindowIcon(QPixmap(QLatin1String(":/images/appicon.png") ));
#endif
diff --git a/src/qdbus/qdbusviewer/main.cpp b/src/qdbus/qdbusviewer/main.cpp
index 7dcebcc06..8a720404c 100644
--- a/src/qdbus/qdbusviewer/main.cpp
+++ b/src/qdbus/qdbusviewer/main.cpp
@@ -45,9 +45,10 @@ int main(int argc, char *argv[])
QCoreApplication::setApplicationName(QStringLiteral("QDBusViewer"));
MainWindow mw;
-#ifndef Q_OS_MAC
+#if !defined(Q_OS_OSX) && !defined(Q_OS_WIN)
app.setWindowIcon(QIcon(QLatin1String(":/qt-project.org/qdbusviewer/images/qdbusviewer.png")));
-#else
+#endif
+#ifdef Q_OS_OSX
mw.setWindowTitle(qApp->translate("QtDBusViewer", "Qt D-Bus Viewer"));
#endif