Wizards: Re-enable using qt quick wizard for qbs

Change-Id: Ic1a3dfbb72096470b4cec2d7af967eba111c743f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Christian Stenger
2023-01-18 13:47:15 +01:00
parent 117b6f1921
commit 13cf1ee948
2 changed files with 66 additions and 5 deletions

View File

@@ -0,0 +1,21 @@
import qbs
CppApplication {
@if "%{UseVirtualKeyboard}" == "true"
Depends { name: "Qt"; submodules: ["quick", "virtualkeyboard"] }
@else
Depends { name: "Qt.quick" }
@endif
install: true
// Additional import path used to resolve QML modules in Qt Creator's code model
property pathList qmlImportPaths: []
files: [
"%{MainCppFileName}",
]
Group {
Qt.core.resourcePrefix: "%{ProjectName}/"
fileTags: ["qt.qml.qml", "qt.core.resource_data"]
files: ["main.qml"]
}
}

View File

@@ -1,6 +1,6 @@
{ {
"version": 1, "version": 1,
"supportedProjectTypes": [ "CMakeProjectManager.CMakeProject" ], "supportedProjectTypes": [ "CMakeProjectManager.CMakeProject", "QbsProjectManager.QbsProject" ],
"id": "U.QtQuickApplicationEmpty", "id": "U.QtQuickApplicationEmpty",
"category": "D.ApplicationQt", "category": "D.ApplicationQt",
"trDescription": "Creates a Qt Quick application that contains an empty window. Optionally, you can create a Qt Design Studio project.", "trDescription": "Creates a Qt Quick application that contains an empty window. Optionally, you can create a Qt Design Studio project.",
@@ -9,15 +9,16 @@
"icon": "icon.png", "icon": "icon.png",
"iconKind": "Themed", "iconKind": "Themed",
"featuresRequired": [ "QtSupport.Wizards.FeatureQtQmlCMakeApi" ], "featuresRequired": [ "QtSupport.Wizards.FeatureQtQmlCMakeApi" ],
"enabled": "%{JS: value('Plugins').indexOf('CMakeProjectManager') >= 0 }", "enabled": "%{JS: value('Plugins').indexOf('CMakeProjectManager') >= 0 || value('Plugins').indexOf('QbsProjectManager') >= 0 }",
"options": "options":
[ [
{ "key": "ProjectFile", "value": "%{ProjectDirectory}/CMakeLists.txt" }, { "key": "ProjectFile", "value": "%{JS: value('BuildSystem') === 'cmake' ? '%{ProjectDirectory}/CMakeLists.txt' : '%{ProjectDirectory}/' + '%{ProjectName}'.toLowerCase() + '.qbs' }" },
{ "key": "MainCppFileName", "value": "%{JS: 'main.' + Util.preferredSuffix('text/x-c++src') }" }, { "key": "MainCppFileName", "value": "%{JS: 'main.' + Util.preferredSuffix('text/x-c++src') }" },
{ "key": "UseVirtualKeyboardByDefault", "value": "%{JS: value('Plugins').indexOf('Boot2Qt') >= 0 || value('Plugins').indexOf('Boot2QtQdb') >= 0 }" }, { "key": "UseVirtualKeyboardByDefault", "value": "%{JS: value('Plugins').indexOf('Boot2Qt') >= 0 || value('Plugins').indexOf('Boot2QtQdb') >= 0 }" },
{ "key": "TargetName", "value": "%{JS: 'app' + value('ProjectName') }" }, { "key": "TargetName", "value": "%{JS: 'app' + value('ProjectName') }" },
{ "key": "QdsWizardPath", "value": "%{IDE:ResourcePath}/qmldesigner/studio_templates/projects" }, { "key": "QdsWizardPath", "value": "%{IDE:ResourcePath}/qmldesigner/studio_templates/projects" },
{ "key": "QdsProjectStyle", "value": "%{JS: value('BuildSystem') === 'cmake' ? %{QdsProjectStyleInput} : false }" },
{ "key": "NoQdsProjectStyle", "value": "%{JS: !%{QdsProjectStyle} }" }, { "key": "NoQdsProjectStyle", "value": "%{JS: !%{QdsProjectStyle} }" },
{ "key": "ImportModuleName", "value": "%{ProjectName}" }, { "key": "ImportModuleName", "value": "%{ProjectName}" },
@@ -42,6 +43,38 @@
"trShortTitle": "Location", "trShortTitle": "Location",
"typeId": "Project" "typeId": "Project"
}, },
{
"trDisplayName": "Define Build System",
"trShortTitle": "Build System",
"typeId": "Fields",
"enabled": "%{JS: ! %{IsSubproject}}",
"data":
[
{
"name": "BuildSystem",
"trDisplayName": "Build system:",
"type": "ComboBox",
"persistenceKey": "BuildSystemType",
"data":
{
"index": 0,
"items":
[
{
"trKey": "CMake",
"value": "cmake",
"condition": "%{JS: value('Plugins').indexOf('CMakeProjectManager') >= 0}"
},
{
"trKey": "Qbs",
"value": "qbs",
"condition": "%{JS: value('Plugins').indexOf('QbsProjectManager') >= 0}"
}
]
}
}
]
},
{ {
"trDisplayName": "Define Project Details", "trDisplayName": "Define Project Details",
"trShortTitle": "Details", "trShortTitle": "Details",
@@ -49,11 +82,12 @@
"data": "data":
[ [
{ {
"name": "QdsProjectStyle", "name": "QdsProjectStyleInput",
"trDisplayName": "Create a project that you can open in Qt Design Studio", "trDisplayName": "Create a project that you can open in Qt Design Studio",
"trToolTip": "Create a project with a structure that is compatible both with Qt Design Studio (via .qmlproject) and with Qt Creator (via CMakeLists.txt). It contains a .ui.qml form that you can visually edit in Qt Design Studio.", "trToolTip": "Create a project with a structure that is compatible both with Qt Design Studio (via .qmlproject) and with Qt Creator (via CMakeLists.txt). It contains a .ui.qml form that you can visually edit in Qt Design Studio.",
"type": "CheckBox", "type": "CheckBox",
"span": true, "span": true,
"visible": "%{JS: value('BuildSystem') === 'cmake'}",
"persistenceKey": "QtQuick.QdsProjectStyle", "persistenceKey": "QtQuick.QdsProjectStyle",
"data": "data":
{ {
@@ -98,7 +132,13 @@
{ {
"source": "CMakeLists.txt", "source": "CMakeLists.txt",
"openAsProject": true, "openAsProject": true,
"condition": "%{NoQdsProjectStyle}" "condition": "%{JS: %{NoQdsProjectStyle} && value('BuildSystem') === 'cmake' }"
},
{
"source": "tmpl.qbs",
"target": "%{ProjectFile}",
"openAsProject": true,
"condition": "%{JS: value('BuildSystem') === 'qbs' }"
}, },
{ {
"source": "main.cpp", "source": "main.cpp",