aboutsummaryrefslogtreecommitdiffstats
path: root/share/qtcreator/templates
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2019-04-05 16:50:34 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2019-04-08 08:01:24 +0000
commitef9e6fbcd785286e70e49b01ba73129d443b10a9 (patch)
tree49462ed03c07a16d2937582157fa0985ab35d05d /share/qtcreator/templates
parentc9608857337a6d52bfc0a07d9a2db679bf406916 (diff)
Add Qbs support for the QtWidgets application wizard
Change-Id: I7b7b7f0642693900f7ba635414450750380955de Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'share/qtcreator/templates')
-rw-r--r--share/qtcreator/templates/wizards/projects/qtwidgetsapplication/project.qbs29
-rw-r--r--share/qtcreator/templates/wizards/projects/qtwidgetsapplication/wizard.json18
2 files changed, 44 insertions, 3 deletions
diff --git a/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/project.qbs b/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/project.qbs
new file mode 100644
index 0000000000..4a54380d6b
--- /dev/null
+++ b/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/project.qbs
@@ -0,0 +1,29 @@
+import qbs.FileInfo
+
+QtApplication {
+ Depends { name: "Qt.widgets" }
+
+ // The following define makes your compiler emit warnings if you use
+ // any Qt feature that has 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.
+ // You can also make your code fail to compile if it uses deprecated APIs.
+ // In order to do so, uncomment the second entry in the list.
+ // You can also select to disable deprecated APIs only up to a certain version of Qt.
+ cpp.defines: [
+ "QT_DEPRECATED_WARNINGS",
+ /* "QT_DISABLE_DEPRECATED_BEFORE=0x060000" */ // disables all the APIs deprecated before Qt 6.0.0
+ ]
+
+ files: [
+ "%{MainFileName}",
+ "%{SrcFileName}",
+ "%{HdrFileName}",
+ @if %{GenerateForm}
+ "%{FormFileName}",
+ @endif
+ ]
+
+ install: true
+ installDir: qbs.targetOS.contains("qnx") ? FileInfo.joinPaths("/tmp", name, "bin") : base
+}
diff --git a/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/wizard.json b/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/wizard.json
index 9aa116177b..004f6e35f8 100644
--- a/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/wizard.json
+++ b/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/wizard.json
@@ -1,6 +1,6 @@
{
"version": 1,
- "supportedProjectTypes": [ "CMakeProjectManager.CMakeProject", "Qt4ProjectManager.Qt4Project" ],
+ "supportedProjectTypes": [ "CMakeProjectManager.CMakeProject", "Qt4ProjectManager.Qt4Project", "Qbs.QbsProject" ],
"id": "C.QtWidgets",
"category": "F.Application",
"trDescription": "Creates a Qt application for the desktop. Includes a Qt Designer-based main window.\n\nPreselects a desktop Qt for building the application if available.",
@@ -8,13 +8,14 @@
"trDisplayCategory": "Application",
"icon": "../../global/guiapplication.png",
"featuresRequired": [ "QtSupport.Wizards.FeatureQt" ],
- "enabled": "%{JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0 || [ %{Plugins} ].indexOf('CMakeProjectManager') >= 0}",
+ "enabled": "%{JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0 || [ %{Plugins} ].indexOf('CMakeProjectManager') >= 0} || [ %{Plugins} ].indexOf('QbsProjectManager') >= 0}",
"options":
[
- { "key": "ProjectFile", "value": "%{JS: '%{BuildSystem}' === 'qmake' ? '%{ProFile}' : '%{CMakeFile}'}" },
+ { "key": "ProjectFile", "value": "%{JS: '%{BuildSystem}' === 'qmake' ? '%{ProFile}' : '%{BuildSystem}' === 'cmake' ? '%{CMakeFile}' : '%{QbsFile}'}" },
{ "key": "ProFile", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'pro')}" },
{ "key": "CMakeFile", "value": "%{ProjectDirectory}/CMakeLists.txt" },
+ { "key": "QbsFile", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'qbs')}" },
{ "key": "MainFileName", "value": "%{JS: 'main.' + Util.preferredSuffix('text/x-c++src')}" },
{ "key": "UiHdrFileName", "value": "%{JS: ('%{BuildSystem}' === 'cmake' ? (Util.path('%{FormFileName}') + '/') : '') + 'ui_' + Util.completeBaseName('%{FormFileName}') + '.h'}" },
{ "key": "CN", "value": "%{JS: Cpp.className('%{Class}')}" },
@@ -54,6 +55,11 @@
"trKey": "CMake",
"value": "cmake",
"condition": "%{JS: [ %{Plugins} ].indexOf('CMakeProjectManager') >= 0}"
+ },
+ {
+ "trKey": "Qbs",
+ "value": "qbs",
+ "condition": "%{JS: [ %{Plugins} ].indexOf('QbsProjectManager') >= 0}"
}
]
}
@@ -164,6 +170,12 @@
"condition": "%{JS: '%{BuildSystem}' === 'cmake'}"
},
{
+ "source": "project.qbs",
+ "target": "%{QbsFile}",
+ "openAsProject": true,
+ "condition": "%{JS: '%{BuildSystem}' === 'qbs'}"
+ },
+ {
"source": "main.cpp",
"target": "%{MainFileName}",
"openInEditor": true