From d7b7fed0cddf6236db3cf1bfdf9cc1380929cf5c Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Mon, 15 Apr 2019 15:59:03 +0200 Subject: Update the QML Runtime icon A new one has been drawn; use it on all platforms, not just on macOS. It is now also used as the default window icon, to be more identifiable when minimized, etc. Of course it can be overridden by plugins that can be loaded from qml. [ChangeLog][QtQml][qml] The QML Runtime tool now has an updated application icon and a default window icon. QtQuick applications can still use QWindow::setIcon() to override the window icon. Task-number: QTBUG-70826 Task-number: QTBUG-74662 Change-Id: I8671d0c99f7f4283dbe2dc4c605abb560f7bf1a1 Reviewed-by: Shawn Rutledge --- tools/qml/Info.plist | 51 ----------------------------------------- tools/qml/main.cpp | 7 +++++- tools/qml/qml.icns | Bin 196156 -> 0 bytes tools/qml/qml.pro | 10 +++++--- tools/qml/qml.qrc | 1 + tools/qml/resources/Info.plist | 51 +++++++++++++++++++++++++++++++++++++++++ tools/qml/resources/qml-64.png | Bin 0 -> 2304 bytes tools/qml/resources/qml.icns | Bin 0 -> 194026 bytes tools/qml/resources/qml.ico | Bin 0 -> 124455 bytes 9 files changed, 65 insertions(+), 55 deletions(-) delete mode 100644 tools/qml/Info.plist delete mode 100644 tools/qml/qml.icns create mode 100644 tools/qml/resources/Info.plist create mode 100644 tools/qml/resources/qml-64.png create mode 100644 tools/qml/resources/qml.icns create mode 100644 tools/qml/resources/qml.ico diff --git a/tools/qml/Info.plist b/tools/qml/Info.plist deleted file mode 100644 index 567c5bf8fd..0000000000 --- a/tools/qml/Info.plist +++ /dev/null @@ -1,51 +0,0 @@ - - - - - NSPrincipalClass - NSApplication - CFBundleIconFile - @ICON@ - CFBundleIdentifier - org.qt-project.qml - CFBundlePackageType - APPL - CFBundleGetInfoString - Created by Qt/QMake - CFBundleSignature - @TYPEINFO@ - CFBundleExecutable - @EXECUTABLE@ - UTExportedTypeDeclarations - - - UTTypeIdentifier - org.qt-project.qml - UTTypeDescription - Qt Markup Language - UTTypeConformsTo - - public.plain-text - - UTTypeTagSpecification - - public.filename-extension - - qml - - - - - CFBundleDocumentTypes - - - LSItemContentTypes - - org.qt-project.qml - - CFBundleTypeRole - Viewer - - - - diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index 7dfae2b53d..8918de57d4 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -77,6 +77,7 @@ static QQmlApplicationEngine *qae = nullptr; static int exitTimerId = -1; #endif bool verboseMode = false; +static const QString iconResourcePath(QStringLiteral(":/qt-project.org/QmlRuntime/resources/qml-64.png")); static void loadConf(const QString &override, bool quiet) // Terminates app on failure { @@ -134,7 +135,10 @@ void noFilesGiven(); class LoaderApplication : public QGuiApplication { public: - LoaderApplication(int& argc, char **argv) : QGuiApplication(argc, argv) {} + LoaderApplication(int& argc, char **argv) : QGuiApplication(argc, argv) + { + setWindowIcon(QIcon(iconResourcePath)); + } bool event(QEvent *ev) override { @@ -450,6 +454,7 @@ int main(int argc, char *argv[]) #ifdef QT_WIDGETS_LIB case QmlApplicationTypeWidget: app = new QApplication(argc, argv); + static_cast(app)->setWindowIcon(QIcon(iconResourcePath)); break; #endif // QT_WIDGETS_LIB #endif // QT_GUI_LIB diff --git a/tools/qml/qml.icns b/tools/qml/qml.icns deleted file mode 100644 index c76051626a..0000000000 Binary files a/tools/qml/qml.icns and /dev/null differ diff --git a/tools/qml/qml.pro b/tools/qml/qml.pro index 3f41707275..f086b7bff9 100644 --- a/tools/qml/qml.pro +++ b/tools/qml/qml.pro @@ -8,10 +8,14 @@ RESOURCES += qml.qrc QMAKE_TARGET_DESCRIPTION = QML Runtime +ICON = resources/qml64.png +win32 { + RC_ICONS = resources/qml.ico +} mac { - OTHER_FILES += Info.plist - QMAKE_INFO_PLIST = Info.plist - ICON = qml.icns + OTHER_FILES += resources/Info.plist + QMAKE_INFO_PLIST = resources/Info.plist + ICON = resources/qml.icns } qtConfig(qml-debug): DEFINES += QT_QML_DEBUG_NO_WARNING diff --git a/tools/qml/qml.qrc b/tools/qml/qml.qrc index 1f0ffdace2..e4be1793d4 100644 --- a/tools/qml/qml.qrc +++ b/tools/qml/qml.qrc @@ -2,5 +2,6 @@ conf/configuration.qml conf/qtquick.qml + resources/qml-64.png diff --git a/tools/qml/resources/Info.plist b/tools/qml/resources/Info.plist new file mode 100644 index 0000000000..567c5bf8fd --- /dev/null +++ b/tools/qml/resources/Info.plist @@ -0,0 +1,51 @@ + + + + + NSPrincipalClass + NSApplication + CFBundleIconFile + @ICON@ + CFBundleIdentifier + org.qt-project.qml + CFBundlePackageType + APPL + CFBundleGetInfoString + Created by Qt/QMake + CFBundleSignature + @TYPEINFO@ + CFBundleExecutable + @EXECUTABLE@ + UTExportedTypeDeclarations + + + UTTypeIdentifier + org.qt-project.qml + UTTypeDescription + Qt Markup Language + UTTypeConformsTo + + public.plain-text + + UTTypeTagSpecification + + public.filename-extension + + qml + + + + + CFBundleDocumentTypes + + + LSItemContentTypes + + org.qt-project.qml + + CFBundleTypeRole + Viewer + + + + diff --git a/tools/qml/resources/qml-64.png b/tools/qml/resources/qml-64.png new file mode 100644 index 0000000000..83dbeab9af Binary files /dev/null and b/tools/qml/resources/qml-64.png differ diff --git a/tools/qml/resources/qml.icns b/tools/qml/resources/qml.icns new file mode 100644 index 0000000000..b092ffd943 Binary files /dev/null and b/tools/qml/resources/qml.icns differ diff --git a/tools/qml/resources/qml.ico b/tools/qml/resources/qml.ico new file mode 100644 index 0000000000..09ec5ccece Binary files /dev/null and b/tools/qml/resources/qml.ico differ -- cgit v1.2.3