From c780151aece1ca31dfe4a283058295469832d56a Mon Sep 17 00:00:00 2001 From: Jussi Witick Date: Tue, 29 Nov 2022 10:42:51 +0200 Subject: [PATCH] Add Qt Safe Renderer helper plugin Initially this plugin will include Qt Creator project wizards for Qt Safe Renderer Task-number: QSR-1874 Change-Id: I3831c875469439ae9576aabd51af050b6af959cf Reviewed-by: hjk Reviewed-by: Reviewed-by: Christian Stenger Reviewed-by: Alessandro Portale --- src/plugins/CMakeLists.txt | 1 + src/plugins/plugins.qbs | 1 + src/plugins/saferenderer/CMakeLists.txt | 8 ++ src/plugins/saferenderer/SafeRenderer.json.in | 20 ++++ src/plugins/saferenderer/saferenderer.cpp | 29 +++++ src/plugins/saferenderer/saferenderer.h | 22 ++++ src/plugins/saferenderer/saferenderer.qbs | 14 +++ src/plugins/saferenderer/saferenderer.qrc | 12 ++ src/plugins/saferenderer/wizards/icon.png | Bin 0 -> 1677 bytes src/plugins/saferenderer/wizards/icon@2x.png | Bin 0 -> 3050 bytes .../saferenderer/wizards/qsrapp/file.pro | 52 +++++++++ .../saferenderer/wizards/qsrapp/main.cpp.tpl | 66 +++++++++++ .../saferenderer/wizards/qsrapp/main.qml.tpl | 26 +++++ .../saferenderer/wizards/qsrapp/qml.qrc.tpl | 5 + .../wizards/qsrapp/safeasset.qrc.tpl | 2 + .../saferenderer/wizards/qsrapp/wizard.json | 103 ++++++++++++++++++ 16 files changed, 361 insertions(+) create mode 100644 src/plugins/saferenderer/CMakeLists.txt create mode 100644 src/plugins/saferenderer/SafeRenderer.json.in create mode 100644 src/plugins/saferenderer/saferenderer.cpp create mode 100644 src/plugins/saferenderer/saferenderer.h create mode 100644 src/plugins/saferenderer/saferenderer.qbs create mode 100644 src/plugins/saferenderer/saferenderer.qrc create mode 100644 src/plugins/saferenderer/wizards/icon.png create mode 100644 src/plugins/saferenderer/wizards/icon@2x.png create mode 100644 src/plugins/saferenderer/wizards/qsrapp/file.pro create mode 100644 src/plugins/saferenderer/wizards/qsrapp/main.cpp.tpl create mode 100644 src/plugins/saferenderer/wizards/qsrapp/main.qml.tpl create mode 100644 src/plugins/saferenderer/wizards/qsrapp/qml.qrc.tpl create mode 100644 src/plugins/saferenderer/wizards/qsrapp/safeasset.qrc.tpl create mode 100644 src/plugins/saferenderer/wizards/qsrapp/wizard.json diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index 1f5c2e8342a..ebcab57a361 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -98,3 +98,4 @@ add_subdirectory(studiowelcome) add_subdirectory(qnx) add_subdirectory(webassembly) add_subdirectory(mcusupport) +add_subdirectory(saferenderer) diff --git a/src/plugins/plugins.qbs b/src/plugins/plugins.qbs index 72484ef4f0a..69ed458bfa4 100644 --- a/src/plugins/plugins.qbs +++ b/src/plugins/plugins.qbs @@ -70,6 +70,7 @@ Project { "qtsupport/qtsupport.qbs", "remotelinux/remotelinux.qbs", "resourceeditor/resourceeditor.qbs", + "saferenderer/saferenderer.qbs", "scxmleditor/scxmleditor.qbs", "serialterminal/serialterminal.qbs", "silversearcher/silversearcher.qbs", diff --git a/src/plugins/saferenderer/CMakeLists.txt b/src/plugins/saferenderer/CMakeLists.txt new file mode 100644 index 00000000000..739332de42d --- /dev/null +++ b/src/plugins/saferenderer/CMakeLists.txt @@ -0,0 +1,8 @@ +add_qtc_plugin(SafeRenderer + DEPENDS + QtCreator::Core QtCreator::ProjectExplorer + SOURCES + saferenderer.qrc + saferenderer.cpp + saferenderer.h +) diff --git a/src/plugins/saferenderer/SafeRenderer.json.in b/src/plugins/saferenderer/SafeRenderer.json.in new file mode 100644 index 00000000000..c8a6e3ee795 --- /dev/null +++ b/src/plugins/saferenderer/SafeRenderer.json.in @@ -0,0 +1,20 @@ +{ + \"Name\" : \"SafeRenderer\", + \"Version\" : \"$$QTCREATOR_VERSION\", + \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", + \"DisabledByDefault\" : true, + \"Vendor\" : \"The Qt Company Ltd\", + \"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\", + \"License\" : [ \"Commercial Usage\", + \"\", + \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\", + \"\", + \"GNU General Public License Usage\", + \"\", + \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" + ], + \"Category\" : \"Device Support\", + \"Description\" : \"Helper plugin for Qt Safe Renderer projects.\", + \"Url\" : \"https://www.qt.io\", + $$dependencyList +} diff --git a/src/plugins/saferenderer/saferenderer.cpp b/src/plugins/saferenderer/saferenderer.cpp new file mode 100644 index 00000000000..115b7c8728b --- /dev/null +++ b/src/plugins/saferenderer/saferenderer.cpp @@ -0,0 +1,29 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include "saferenderer.h" + +#include + +namespace SafeRenderer::Internal { + +SafeRendererPlugin::SafeRendererPlugin() +{ +} + +SafeRendererPlugin::~SafeRendererPlugin() +{ +} + +bool SafeRendererPlugin::initialize(const QStringList &arguments, QString *errorString) +{ + Q_UNUSED(arguments) + Q_UNUSED(errorString) + + // Add Qt Creator project wizard path + ProjectExplorer::JsonWizardFactory::addWizardPath(":/saferenderer/wizards/"); + + return true; +} + +} // namespace SafeRenderer::Internal diff --git a/src/plugins/saferenderer/saferenderer.h b/src/plugins/saferenderer/saferenderer.h new file mode 100644 index 00000000000..1fabbff9ee1 --- /dev/null +++ b/src/plugins/saferenderer/saferenderer.h @@ -0,0 +1,22 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#pragma once + +#include + +namespace SafeRenderer::Internal { + +class SafeRendererPlugin : public ExtensionSystem::IPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "SafeRenderer.json") + +public: + SafeRendererPlugin(); + ~SafeRendererPlugin() override; + + bool initialize(const QStringList &arguments, QString *errorString) override; +}; + +} // namespace SafeRenderer::Internal diff --git a/src/plugins/saferenderer/saferenderer.qbs b/src/plugins/saferenderer/saferenderer.qbs new file mode 100644 index 00000000000..7945054eaec --- /dev/null +++ b/src/plugins/saferenderer/saferenderer.qbs @@ -0,0 +1,14 @@ +import qbs + +QtcPlugin { + name: "SafeRenderer" + + Depends { name: "Core" } + Depends { name: "ProjectExplorer" } + + files: [ + "saferenderer.cpp", + "saferenderer.h", + "saferenderer.qrc", + ] +} diff --git a/src/plugins/saferenderer/saferenderer.qrc b/src/plugins/saferenderer/saferenderer.qrc new file mode 100644 index 00000000000..28baa346473 --- /dev/null +++ b/src/plugins/saferenderer/saferenderer.qrc @@ -0,0 +1,12 @@ + + + wizards/icon.png + wizards/icon@2x.png + wizards/qsrapp/file.pro + wizards/qsrapp/main.cpp.tpl + wizards/qsrapp/main.qml.tpl + wizards/qsrapp/qml.qrc.tpl + wizards/qsrapp/safeasset.qrc.tpl + wizards/qsrapp/wizard.json + + diff --git a/src/plugins/saferenderer/wizards/icon.png b/src/plugins/saferenderer/wizards/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..88826ce9fb0a21ff29cbd3b240b0b04bfdc7bfbf GIT binary patch literal 1677 zcmeAS@N?(olHy`uVBq!ia0y~yU@!n-4mJh`hH$2z?FGw{YnYAd}`g?Om`P-S+ z>HA{d^Uu@&|M~a)&%fVVp8q+&_?RM>iPYKkx3}e9KAB=9)VupafrZST6t$+PwcBK^ z%hv2zu;4*^tI*Mo?Si}+TW{T}{rzpKe$qz5&z;jla6j_{PE+*mN#$Sn9V*r?bzo< z#@T^MUYU#H*1yll%ll_&XE#sl;`7h0Pg$BBdwP3apZ50k1@&sO$u;<_zy81Q;h|QY zRwu`)U!I;8m*8QWGJX2vqut_*=7g`0JD6eOwEXhJe}8{3n&Us;?qJqdC1qvi^YiWd z&o+jwF5PuE&xw2geSa@+Z_b97$5V_ZzP`R*c=~DAynA~*SFKvbalBA*&ZJ2~MQ?AJ zUb=eKH7Yv#Fs5 zt(k29KoKPD!te3kwY!Jd5uyUca7S z=J>$`gMj|Rr>8{4JagD?-M)P|NmEmkLCrk>{^Ps5%NZJadU#^?R*728&5K&%we-+L zW%olxyLRpR@bhzemhTldH8r&h*RP9maV$+c9k2d|Nb)Fx?tupA?B@(9_@Ye=E*S}*j4)a(5+>!8V)~P zAjXnVw=7^u?CYc5;(|PEfq{X7*V0U+42_JM9zINDIMB{7&rnlsJW*ldnTlA^Q%hCV zR8>2VaVqYp`Dx^%CM?3m8lxv(G0#0PP|!q*S4Yg7qr9X<#BH%))>f&xbLXyDvu250 zb{Lxo7we_VmmhwtICSgVySv@&{BjF6Z4%1bD%I$~;OXfpAtTdrHjVq?yIWhiOG`^9 zoPJvI>&wa)5i@7byuvm^>*GS__7(o&+wQWZP}CO&yP=%Yx?q~+;K;Q?B<$Cpy1$67bV55Tem)WdU|^Cwf_eW zI3&Ejwst>r$82%tUG^n6;14X zG6F1)1`Hew#UBLqMQr5w&!l~x-=y$|Cm~7e-+qG!A1gN0|NkfFDDdf{{>KA0{tI^= z*qnYo!EAOltK)^o)*lZj)icMf7f;*#Q{PdbL_m;VCkezC6&2m9H(i_G;mH3)RlfFS v_77zbmt1^!ZmxBGc}d9&gXRi`AMBYA=eDujyjR7*z`)??>gTe~DWM4fWKI}b literal 0 HcmV?d00001 diff --git a/src/plugins/saferenderer/wizards/icon@2x.png b/src/plugins/saferenderer/wizards/icon@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..1838ac95117f17e6b2eff3939c359fc87490068c GIT binary patch literal 3050 zcmeAS@N?(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nIKzGTURmBGs|y#9LX z?$>Y*f%`lRulBbx)n(AX%VIvo_J#Vi2`s>@77`_)Z z-}x)#6CN&}cX!v+-KsO^&h34Ee!lzm+q&h~)s8;?nBeKzX>Dluaew2Z|GK;%K0i4r zyr=N7Tgd*O`fUM^gsYA8j#_-8yl0` zw=Z1yunSMJ{QLQQpM2eqh4&v8tYK-eue{bRsHt=M(Z1T> zd#d*C<7arrVWQ`z^5f|8%wPKgJ|?qy9GD(ock)HaE=L9rzSU)C7&2F`Sdox1t4<~C z&kROEh1MU2%q~HJfd@0TMpZ9)beu=vV0e7((N`tA>=_*<{eK_+?&F`e7KM*mmONq> os9}0o>Qh))cvxZKkN?b*WVliV4u_p$U|?YIboFyt=akR{0Oh68(*OVf literal 0 HcmV?d00001 diff --git a/src/plugins/saferenderer/wizards/qsrapp/file.pro b/src/plugins/saferenderer/wizards/qsrapp/file.pro new file mode 100644 index 00000000000..0302daad207 --- /dev/null +++ b/src/plugins/saferenderer/wizards/qsrapp/file.pro @@ -0,0 +1,52 @@ +QT = qtsaferenderer qsrplatformadaptation + +CONFIG += c++17 + +# The following define makes your compiler emit warnings if you use +# any feature of Qt which as been marked deprecated (the exact warnings +# depend on your compiler). Please consult the documentation of the +# deprecated API in order to know how to port your code away from it. +DEFINES += QT_DEPRECATED_WARNINGS + +# You can make your code fail to compile if it uses deprecated APIs. +# In order to do so, uncomment the following line. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + +SOURCES += \\ + %{CppFileName} + + +# List of language codes that your application supports. For example, SAFE_LANGUAGES = en fi. +#SAFE_LANGUAGES = en + +# List of translation file names excluding the language code. For example, SAFE_TRANSLATION = $$PWD/safeui. +#SAFE_TRANSLATION = $$PWD/safeui + +# List of translation file names including the language code. There must be one file +# for each language listed in SAFE_LANGUAGES. For example, TRANSLATIONS += safeui_en.ts safeui_fi.ts. +#TRANSLATIONS += safeui_en.ts + +# You can use an lupdate_only{...} conditional statement to specify the QML files that contain texts. +#lupdate_only { +# SOURCES += main.qml +#} + + +RESOURCES += qml.qrc + +# Additional import path used to resolve QML modules in Qt Creator's code model +QML_IMPORT_PATH = $$PWD/imports + +# Additional import path used to resolve QML modules just for Qt Quick Designer +QML_DESIGNER_IMPORT_PATH = + + +CONFIG += qtsaferenderer exceptions +SAFE_QML = $$PWD/main.qml +SAFE_LAYOUT_PATH = $$PWD/layoutData +SAFE_RESOURCES += safeasset.qrc + +!cross_compile: DEFINES += HOST_BUILD +!cross_compile: QT += widgets quick svg + +DISTFILES += main.qml diff --git a/src/plugins/saferenderer/wizards/qsrapp/main.cpp.tpl b/src/plugins/saferenderer/wizards/qsrapp/main.cpp.tpl new file mode 100644 index 00000000000..4f36c6f6fa3 --- /dev/null +++ b/src/plugins/saferenderer/wizards/qsrapp/main.cpp.tpl @@ -0,0 +1,66 @@ +%{Cpp:LicenseTemplate}\ +%{JS: QtSupport.qtIncludes([ 'QtCore/QCoreApplication' ], + [ 'QtCore/QCoreApplication' ]) }\ + +#include +#include +#include + +#if defined(HOST_BUILD) +#include +#include +#include +#endif + +#if defined(USE_OUTPUTVERIFIER) +#include +#include "testverifier.h" +#endif + +#include "safewindow.h" +#include "eventhandler.h" + +int main(int argc, char *argv[]) +{ + Q_UNUSED(argc); + Q_UNUSED(argv); + + static SafeRenderer::QSafeLayoutResourceReader layout("/layoutData/main/main.srl"); + +#if defined(USE_OUTPUTVERIFIER) + static OutputVerifier outputVerifier; +#if defined(HOST_BUILD) + //In host environment the TestVerifier must be explicitly created. + //In OpeWFD adaptation the MISRVerifier instance is created in the SafeWindow adaptation. + static TestVerifier testVerifier(outputVerifier); +#endif + SafeWindow telltaleWindow(layout.size(), QSafePoint(0U, 0U), outputVerifier); +#else + SafeWindow telltaleWindow(layout.size(), QSafePoint(0U, 0U)); +#endif + static SafeRenderer::StateManager stateManager(telltaleWindow, layout); + telltaleWindow.requestUpdate(); //Request is required because eventHandler is not running yet. + +#if defined(USE_OUTPUTVERIFIER) + EventHandler msgHandler(stateManager, telltaleWindow, outputVerifier); +#else + EventHandler msgHandler(stateManager, telltaleWindow); +#endif + +#if defined(HOST_BUILD) + //Mixing the Qt and Qt Safe Renderer renderers is done here only for demonstration purposes on host, not for production purposes of any kind. + QQmlApplicationEngine engine; + const QUrl url(QStringLiteral("qrc:/main.qml")); + QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, qApp, + [url](QObject *obj, const QUrl &objUrl) { + if (!obj && url == objUrl) + qDebug() << "Failed to start the main.qml"; + }, Qt::QueuedConnection); + engine.addImportPath(":/imports"); + engine.load(url); +#endif + + msgHandler.handleEvents(); + + return 0; +} diff --git a/src/plugins/saferenderer/wizards/qsrapp/main.qml.tpl b/src/plugins/saferenderer/wizards/qsrapp/main.qml.tpl new file mode 100644 index 00000000000..94fccebcb2a --- /dev/null +++ b/src/plugins/saferenderer/wizards/qsrapp/main.qml.tpl @@ -0,0 +1,26 @@ +import Qt.SafeRenderer 2.0 +import QtQuick.Window 2.15 + +Window { + id: window + width: 640 + height: 480 + visible: true + title: qsTr("Hello QSR") + + SafeText { + id: safeText + objectName: "safetextitem" + x: 206 + y: 208 + width: 340 + height: 34 + color: "#8ae234" + fillColor: "black" + text: "Hello Qt Safe Renderer!" + font.family: "Lato" + horizontalAlignment: Text.AlignLeft + font.pixelSize: 32 + runtimeEditable: true + } +} diff --git a/src/plugins/saferenderer/wizards/qsrapp/qml.qrc.tpl b/src/plugins/saferenderer/wizards/qsrapp/qml.qrc.tpl new file mode 100644 index 00000000000..5f6483ac33f --- /dev/null +++ b/src/plugins/saferenderer/wizards/qsrapp/qml.qrc.tpl @@ -0,0 +1,5 @@ + + + main.qml + + diff --git a/src/plugins/saferenderer/wizards/qsrapp/safeasset.qrc.tpl b/src/plugins/saferenderer/wizards/qsrapp/safeasset.qrc.tpl new file mode 100644 index 00000000000..601b61fc4c2 --- /dev/null +++ b/src/plugins/saferenderer/wizards/qsrapp/safeasset.qrc.tpl @@ -0,0 +1,2 @@ + + diff --git a/src/plugins/saferenderer/wizards/qsrapp/wizard.json b/src/plugins/saferenderer/wizards/qsrapp/wizard.json new file mode 100644 index 00000000000..e05e5f7971a --- /dev/null +++ b/src/plugins/saferenderer/wizards/qsrapp/wizard.json @@ -0,0 +1,103 @@ +{ + "version": 1, + "supportedProjectTypes": [ "Qt4ProjectManager.Qt4Project" ], + "id": "E.QSRApp", + "category": "D.QtSafeRendererApplication", + "trDescription": "Creates a Qt Safe Renderer project with simple UI and project setup.", + "trDisplayName": "Qt Safe Renderer Application", + "trDisplayCategory": "Application (Qt Safe Renderer)", + "icon": "../icon.png", + "iconKind": "Themed", + "featuresRequired": [ "QtSupport.Wizards.FeatureQt" ], + "enabled": "%{JS: value('Plugins').indexOf('QmakeProjectManager') >= 0 || value('Plugins').indexOf('CMakeProjectManager') >= 0}", + + "options": + [ + { "key": "ProjectFile", "value": "%{JS: value('BuildSystem') == 'qmake' ? value('ProFile') : value('CMakeFile')}" }, + { "key": "ProFile", "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'pro')}" }, + { "key": "HasTranslation", "value": "%{JS: value('TsFileName') !== ''}" }, + { "key": "CppFileName", "value": "%{JS: 'main.' + Util.preferredSuffix('text/x-c++src')}" } + ], + + "pages": + [ + { + "trDisplayName": "Project Location", + "trShortTitle": "Location", + "typeId": "Project", + "data": { "trDescription": "This wizard creates a simple Qt Safe Renderer application." } + }, + { + "trDisplayName": "Define Build System", + "trShortTitle": "Build System", + "typeId": "Fields", + "enabled": "%{JS: !value('IsSubproject')}", + "data": + [ + { + "name": "BuildSystem", + "trDisplayName": "Build system:", + "type": "ComboBox", + "persistenceKey": "BuildSystemType", + "data": + { + "index": 0, + "items": + [ + { + "trKey": "qmake", + "value": "qmake", + "condition": "%{JS: value('Plugins').indexOf('QmakeProjectManager') >= 0}" + } + ] + } + } + ] + }, + { + "trDisplayName": "Kit Selection", + "trShortTitle": "Kits", + "typeId": "Kits", + "enabled": "%{JS: !value('IsSubproject')}", + "data": { "projectFilePath": "%{ProjectFile}" } + }, + { + "trDisplayName": "Project Management", + "trShortTitle": "Summary", + "typeId": "Summary" + } + ], + "generators": + [ + { + "typeId": "File", + "data": + [ + { + "source": "file.pro", + "target": "%{ProFile}", + "openAsProject": true, + "condition": "%{JS: value('BuildSystem') === 'qmake'}" + }, + { + "source": "main.cpp.tpl", + "target": "%{CppFileName}", + "openInEditor": false + }, + { + "source": "safeasset.qrc.tpl", + "target": "safeasset.qrc" + }, + { + "source": "qml.qrc.tpl", + "target": "qml.qrc" + }, + { + "source": "main.qml.tpl", + "target": "main.qml", + "openInEditor": true + } + ] + } + ] +}