McuSupport: Add an empty MCU project template

In addition to the descriptive Qmlproject base template containing
hints about most possible configurations, this template is intended
to be as blank as possible for a cleaner project configuration for the
case where the properties already known by the developer.

Task-number: QTCREATORBUG-29192
Change-Id: I670bc502ba30d5297668c77004ddfdf756764809
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Sivert Krøvel <sivert.krovel@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Yasser Grimes
2023-06-02 11:51:15 +03:00
parent dde5f1aab0
commit febfa73d29
7 changed files with 169 additions and 3 deletions

View File

@@ -21,5 +21,9 @@
<file>wizards/qmlproject/component.qml.tpl</file> <file>wizards/qmlproject/component.qml.tpl</file>
<file>wizards/qmlproject/wizard.json</file> <file>wizards/qmlproject/wizard.json</file>
<file>wizards/qmlproject/Qul.cmake</file> <file>wizards/qmlproject/Qul.cmake</file>
<file>wizards/qmlproject-empty/CMakeLists.txt</file>
<file>wizards/qmlproject-empty/main.qml.tpl</file>
<file>wizards/qmlproject-empty/project.qmlproject.tpl</file>
<file>wizards/qmlproject-empty/wizard.json</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@@ -0,0 +1,8 @@
cmake_minimum_required (VERSION 3.21.1)
project(%{CorrectedProjectName} VERSION 0.0.1 LANGUAGES C CXX ASM)
find_package(Qul)
qul_add_target(%{CorrectedProjectName} QML_PROJECT %{QmlProjectFile} GENERATE_ENTRYPOINT)
app_target_setup_os(%{CorrectedProjectName})

View File

@@ -0,0 +1,8 @@
import QtQuick
Rectangle {
Text {
anchors.centerIn: parent
text: "Qt for MCUs"
}
}

View File

@@ -0,0 +1,75 @@
import QmlProject 1.3
Project {
qtForMCUs: true // Required by QDS to enable/disable features Supported/Unsupported by QtMCUs projects. Currently ignored by qmlprojectexporter.
// importPaths: [] // Alternative API to ModuleFiles for importing modules.
// projectRootPath: "." // Optional root path relative to qmlproject file path.
mainFile: "%{MainQmlFile}" // The application's entrypoint
MCU.Config {
controlsStyle: "QtQuick.Controls.StyleDefault"
debugBytecode: false
debugLineDirectives: false
// maxResourceCacheSize: 0 // Set to 0 by default. Required for OnDemand resource cache policy and resource compression.
// Global settings for image properties. Can be overridden for selected resources in ImageFiles nodes.
resourceImagePixelFormat: "Automatic"
resourceCachePolicy: "NoCaching"
resourceCompression: false
// Font engine selection
fontEngine: "Static" // alternative option: "Spark".
// Font defaults for both engines
defaultFontFamily: "DejaVu Sans Mono"
defaultFontQuality: "VeryHigh"
glyphsCachePolicy: "NoCaching"
maxParagraphSize: 100
// Font properties for "Static"
addDefaultFonts: true // Set to false to disable add adding default fonts to your project.
autoGenerateGlyphs: true
// Font properties for "Spark"
// These properties are in effect only if the "Spark" font engine is used
complexTextRendering: true // Set this to false if complex scripts are not needed (Arabic scripts, Indic scripts, etc.)
fontCachePriming: false // Set to true to decrease application startup time. Only applies to fonts configured with unicode ranges (font.unicodeCoverage).
fontCacheSize: 0 // If this is needed, use a suitable number. Setting this to a sensible value will improve performance, the global default is 104800.
fontHeapSize: -1 // Set to sufficient value to improve performance. -1 means no restrictions to heap allocation.
fontHeapPrealloc: true
fontCachePrealloc: true
}
QmlFiles {
files: ["%{MainQmlFile}"]
}
ImageFiles {
files: []
}
FontFiles {
files: []
}
TranslationFiles {
files: []
}
InterfaceFiles {
files: []
}
ModuleFiles {
files: []
// Uncomment for adding Qul modules
MCU.qulModules: [
// "Qul::Controls",
// "Qul::ControlsTemplates",
// "Qul::Shapes",
// "Qul::Timeline"
]
}
}

View File

@@ -0,0 +1,71 @@
{
"version": 1,
"supportedProjectTypes": [ "CMakeProjectManager.CMakeProject" ],
"id": "M.McuSupportApplicationEmpty",
"category": "D.ApplicationMCU",
"trDescription": "Suitable for Qt for MCUs versions 2.4 and later. Creates an empty application that you can deploy, run and debug on MCU boards",
"trDisplayName": "Qt for MCUs Empty Application",
"trDisplayCategory": "QmlProject Application (Qt for MCUs)",
"icon": "../icon.png",
"iconKind": "Themed",
"enabled": true,
"options":
[
{ "key": "CorrectedProjectName", "value": "%{JS: '%{ProjectName}'.replace(/-/g, '_')}"},
{ "key": "MainQmlFile", "value": "%{CorrectedProjectName}.qml" },
{ "key": "QmlProjectFile", "value": "%{CorrectedProjectName}.qmlproject" },
{ "key": "CMakeFile", "value": "%{CorrectedProjectName}/CMakeLists.txt" }
],
"pages":
[
{
"trDisplayName": "Project Location",
"trShortTitle": "Location",
"typeId": "Project"
},
{
"trDisplayName": "Kit Selection",
"trShortTitle": "Kits",
"typeId": "Kits",
"enabled": "%{JS: !value('IsSubproject')}",
"data": {
"projectFilePath": "%{CMakeFile}"
}
},
{
"trDisplayName": "Project Management",
"trShortTitle": "Summary",
"typeId": "Summary"
}
],
"generators":
[
{
"typeId": "File",
"data":
[
{
"source": "CMakeLists.txt",
"openAsProject": true
},
{
"source": "project.qmlproject.tpl",
"target": "%{ProjectDirectory}/%{QmlProjectFile}",
"openInEditor": true
},
{
"source": "main.qml.tpl",
"target": "%{ProjectDirectory}/%{MainQmlFile}",
"openInEditor": true
},
{
"source": "%{IDE:ResourcePath}/templates/wizards/projects/git.ignore",
"target": ".gitignore",
"condition": "%{JS: !value('IsSubproject') && value('VersionControl') === 'G.Git'}"
}
]
}
]
}

View File

@@ -4,7 +4,7 @@ Project {
qtForMCUs: true // Required by QDS to enable/disable features Supported/Unsupported by QtMCUs projects. Currently ignored by qmlprojectexporter. qtForMCUs: true // Required by QDS to enable/disable features Supported/Unsupported by QtMCUs projects. Currently ignored by qmlprojectexporter.
// importPaths: ["imports/CustomModule"] // Alternative API for importing modules. // importPaths: ["imports/CustomModule"] // Alternative API for importing modules.
// projectRootPath: "." // Optional root path relative to qmlproject file path. // projectRootPath: "." // Optional root path relative to qmlproject file path.
mainFile: "%{MainQmlFile}" // Required to determin which qml file is the application entrypoint, when no custom c++ entrypoint is specified. mainFile: "%{MainQmlFile}" // The application's entrypoint
/* Global configuration */ /* Global configuration */
MCU.Config { MCU.Config {

View File

@@ -1,10 +1,10 @@
{ {
"version": 1, "version": 1,
"supportedProjectTypes": [ "CMakeProjectManager.CMakeProject" ], "supportedProjectTypes": [ "CMakeProjectManager.CMakeProject" ],
"id": "M.McuSupportApplication", "id": "M.McuSupportApplicationExample",
"category": "D.ApplicationMCU", "category": "D.ApplicationMCU",
"trDescription": "Suitable for Qt for MCUs versions 2.4 and later. Creates an application that uses a subset of Qt QML and Qt Quick Controls types (as supported by Qt for MCUs) that you can deploy, run, and debug on MCU boards.", "trDescription": "Suitable for Qt for MCUs versions 2.4 and later. Creates an application that uses a subset of Qt QML and Qt Quick Controls types (as supported by Qt for MCUs) that you can deploy, run, and debug on MCU boards.",
"trDisplayName": "Qt for MCUs Application", "trDisplayName": "Qt for MCUs Example Application",
"trDisplayCategory": "QmlProject Application (Qt for MCUs)", "trDisplayCategory": "QmlProject Application (Qt for MCUs)",
"icon": "../icon.png", "icon": "../icon.png",
"iconKind": "Themed", "iconKind": "Themed",