diff options
author | Eike Ziller <eike.ziller@qt.io> | 2019-04-16 16:46:36 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2019-05-09 11:19:43 +0000 |
commit | e0d38ae4140d6101b483fde25158fc94b34a3a64 (patch) | |
tree | 9137897e6cc85c195ff76ebedc9de0d9a447a168 /share/qtcreator/templates | |
parent | 0c5837a1114ef526727748a0db956f0758597350 (diff) |
Export Wizard values to JavaScript macro
Registers a new function "value('name')", available to the wizard json
files, which returns the value of the variable "name" as a JavaScript
object. So, variables with a string value are actual JavaScript strings,
booleans are booleans, lists are lists, and dictionaries are
dictionaries.
The patch also makes it actually possible to assign JSON lists and
dictionaries to values.
This removes some hacks involving creating complex JavaScript objects
through string substitution.
Change-Id: I4ac6da22bc5bccc9fadee97694c2fa14d44c9307
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'share/qtcreator/templates')
38 files changed, 612 insertions, 563 deletions
diff --git a/share/qtcreator/templates/wizards/autotest/wizard.json b/share/qtcreator/templates/wizards/autotest/wizard.json index 64e8b8d6af..fd56df0578 100644 --- a/share/qtcreator/templates/wizards/autotest/wizard.json +++ b/share/qtcreator/templates/wizards/autotest/wizard.json @@ -8,19 +8,19 @@ "trDisplayCategory": "Other Project", "icon": "autotest.png", "featuresRequired": [ "QtSupport.Wizards.FeatureDesktop" ], - "enabled": "%{JS: [ %{Plugins} ].indexOf('AutoTest') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('AutoTest') >= 0}", "options": [ { "key": "ProjectFilePath", - "value": "%{JS: '%{BuildSystem}' == 'qmake' ? '%{ProFileName}' : ('%{BuildSystem}' == 'qbs' ? '%{QbsFileName}' : '%{CMakeFileName}') }" + "value": "%{JS: value('BuildSystem') == 'qmake' ? value('ProFileName') : (value('BuildSystem') == 'qbs' ? value('QbsFileName') : value('CMakeFileName')) }" }, { "key": "ProFileName", - "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'pro')}" + "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'pro')}" }, { "key": "QbsFileName", - "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'qbs')}" + "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'qbs')}" }, { "key": "CMakeFileName", @@ -34,19 +34,19 @@ }, { "key": "TestCaseFileWithHeaderSuffix", - "value": "%{JS: 'tst_%{TestCaseName}.'.toLowerCase() + Util.preferredSuffix('text/x-c++hdr') }" + "value": "%{JS: 'tst_' + value('TestCaseName').toLowerCase() + '.' + Util.preferredSuffix('text/x-c++hdr') }" }, { "key": "GUARD", - "value": "%{JS: '%{TestCaseFileWithHeaderSuffix}'.toUpperCase().replace('.', '_') }" + "value": "%{JS: value('TestCaseFileWithHeaderSuffix').toUpperCase().replace('.', '_') }" }, { "key": "TestCaseFileWithCppSuffix", - "value": "%{JS: 'tst_%{TestCaseName}.'.toLowerCase() + Util.preferredSuffix('text/x-c++src') }" + "value": "%{JS: 'tst_' + value('TestCaseName').toLowerCase() + '.' + Util.preferredSuffix('text/x-c++src') }" }, { "key": "TestCaseFileWithQmlSuffix", - "value": "%{JS: 'tst_%{TestCaseName}.qml'.toLowerCase() }" + "value": "%{JS: 'tst_' + value('TestCaseName').toLowerCase() + '.qml' }" } ], @@ -95,7 +95,7 @@ { "name": "RequireGUI", "trDisplayName": "GUI Application", - "visible": "%{JS: '%{TestFrameWork}' === 'QtTest'}", + "visible": "%{JS: value('TestFrameWork') === 'QtTest'}", "type": "CheckBox", "data": { "checked": false @@ -111,7 +111,7 @@ { "name": "RequireApplication", "trDisplayName": "Requires QApplication", - "visible": "%{JS: '%{TestFrameWork}' === 'QtTest'}", + "visible": "%{JS: value('TestFrameWork') === 'QtTest'}", "type": "CheckBox", "data": { "checked": false @@ -120,7 +120,7 @@ { "name": "GenerateInitAndCleanup", "trDisplayName": "Generate initialization and cleanup code", - "visible": "%{JS: [ 'QtTest', 'QtQuickTest' ].indexOf('%{TestFrameWork}') >= 0 }", + "visible": "%{JS: [ 'QtTest', 'QtQuickTest' ].indexOf(value('TestFrameWork')) >= 0 }", "type": "CheckBox", "data": { "checked": false @@ -129,14 +129,14 @@ { "name": "TestSetName", "trDisplayName": "Test set name:", - "visible": "%{JS: '%{TestFrameWork}' === 'GTest'}", + "visible": "%{JS: value('TestFrameWork') === 'GTest'}", "type": "LineEdit", "data": { "validator": "^[a-zA-Z0-9]+$" } }, { "name": "GTestCXX11", "trDisplayName": "Enable C++11", - "visible": "%{JS: '%{TestFrameWork}' === 'GTest'}", + "visible": "%{JS: value('TestFrameWork') === 'GTest'}", "type": "CheckBox", "data": { "checked": false @@ -145,7 +145,7 @@ { "name": "GTestRepository", "trDisplayName": "Googletest repository:", - "visible": "%{JS: '%{TestFrameWork}' === 'GTest'}", + "visible": "%{JS: value('TestFrameWork') === 'GTest'}", "type": "PathChooser", "data": { "kind": "existingDirectory" @@ -163,17 +163,17 @@ { "trKey": "qmake", "value": "qmake", - "condition": "%{JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0}" + "condition": "%{JS: value('Plugins').indexOf('QmakeProjectManager') >= 0}" }, { "trKey": "CMake", "value": "cmake", - "condition": "%{JS: [ %{Plugins} ].indexOf('CMakeProjectManager') >= 0}" + "condition": "%{JS: value('Plugins').indexOf('CMakeProjectManager') >= 0}" }, { "trKey": "Qbs", "value": "qbs", - "condition": "%{JS: [ %{Plugins} ].indexOf('QbsProjectManager') >= 0}" + "condition": "%{JS: value('Plugins').indexOf('QbsProjectManager') >= 0}" } ] } @@ -187,7 +187,7 @@ "enabled": "%{IsTopLevelProject}", "data": { "projectFilePath": "%{ProjectFilePath}", - "requiredFeatures": [ "%{JS: ('%{TestFrameWork}' === 'QtQuickTest' ? 'QtSupport.Wizards.FeatureQt.5' : (('%{BuildSystem}' === 'qmake' || '%{TestFrameWork}' === 'QtTest') ? 'QtSupport.Wizards.FeatureQt' : 'DeviceType.Desktop' )) }" ] + "requiredFeatures": [ "%{JS: (value('TestFrameWork') === 'QtQuickTest' ? 'QtSupport.Wizards.FeatureQt.5' : ((value('BuildSystem') === 'qmake' || value('TestFrameWork') === 'QtTest') ? 'QtSupport.Wizards.FeatureQt' : 'DeviceType.Desktop' )) }" ] } }, { @@ -205,64 +205,64 @@ { "source": "files/gtest_dependency.pri", "target": "gtest_dependency.pri", - "condition": "%{JS: '%{TestFrameWork}' == 'GTest' && '%{BuildSystem}' == 'qmake'}", + "condition": "%{JS: value('TestFrameWork') == 'GTest' && value('BuildSystem') == 'qmake'}", "openInEditor": false }, { "source": "files/googlecommon.js", "target": "googlecommon.js", - "condition": "%{JS: '%{TestFrameWork}' == 'GTest' && '%{BuildSystem}' == 'qbs'}", + "condition": "%{JS: value('TestFrameWork') == 'GTest' && value('BuildSystem') == 'qbs'}", "openInEditor": false }, { "source": "files/tst.pro", "target": "%{ProjectFilePath}", - "condition": "%{JS: '%{BuildSystem}' == 'qmake'}", + "condition": "%{JS: value('BuildSystem') == 'qmake'}", "openInEditor": false, "openAsProject": true }, { "source": "files/tst.qbs", "target": "%{ProjectFilePath}", - "condition": "%{JS: '%{BuildSystem}' == 'qbs'}", + "condition": "%{JS: value('BuildSystem') == 'qbs'}", "openInEditor": false, "openAsProject": true }, { "source": "files/tst.txt", "target": "CMakeLists.txt", - "condition": "%{JS: '%{BuildSystem}' == 'cmake'}", + "condition": "%{JS: value('BuildSystem') == 'cmake'}", "openInEditor": false, "openAsProject": true }, { "source": "files/tst_src.h", "target": "%{TestCaseFileWithHeaderSuffix}", - "condition": "%{JS: '%{TestFrameWork}' == 'GTest'}", + "condition": "%{JS: value('TestFrameWork') == 'GTest'}", "openInEditor": true }, { "source": "files/tst_src.cpp", "target": "%{TestCaseFileWithCppSuffix}", - "condition": "%{JS: '%{TestFrameWork}' == 'QtTest'}", + "condition": "%{JS: value('TestFrameWork') == 'QtTest'}", "openInEditor": true }, { "source": "files/tst_main.cpp", "target": "%{MainCppName}", - "condition": "%{JS: ['GTest', 'QtQuickTest'].indexOf('%{TestFrameWork}') >= 0}", + "condition": "%{JS: ['GTest', 'QtQuickTest'].indexOf(value('TestFrameWork')) >= 0}", "openInEditor": true }, { "source": "files/tst_qml.tmpl", "target": "%{TestCaseFileWithQmlSuffix}", - "condition": "%{JS: '%{TestFrameWork}' === 'QtQuickTest'}", + "condition": "%{JS: value('TestFrameWork') === 'QtQuickTest'}", "openInEditor": true }, { "source": "../projects/git.ignore", "target": ".gitignore", - "condition": "%{JS: ( %{IsTopLevelProject} && '%{VersionControl}' === 'G.Git' )}" + "condition": "%{JS: ( %{IsTopLevelProject} && value('VersionControl') === 'G.Git' )}" } ] } diff --git a/share/qtcreator/templates/wizards/classes/cpp/wizard.json b/share/qtcreator/templates/wizards/classes/cpp/wizard.json index 54c7dcabfd..dd67d0dd59 100644 --- a/share/qtcreator/templates/wizards/classes/cpp/wizard.json +++ b/share/qtcreator/templates/wizards/classes/cpp/wizard.json @@ -7,18 +7,18 @@ "trDisplayName": "C++ Class", "trDisplayCategory": "C++", "iconText": "h/cpp", - "enabled": "%{JS: [ %{Plugins} ].indexOf('CppEditor') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('CppEditor') >= 0}", "options": [ { "key": "TargetPath", "value": "%{Path}" }, { "key": "HdrPath", "value": "%{Path}/%{HdrFileName}" }, { "key": "SrcPath", "value": "%{Path}/%{SrcFileName}" }, - { "key": "CN", "value": "%{JS: Cpp.className('%{Class}')}" }, - { "key": "Base", "value": "%{JS: ( '%{BaseCB}' === '' ) ? '%{BaseEdit}' : '%{BaseCB}'}" }, - { "key": "isQObject", "value": "%{JS: [ 'QObject', 'QWidget', 'QMainWindow', 'QDeclarativeItem', 'QQuickItem'].indexOf('%{Base}') >= 0 }" }, - { "key": "GUARD", "value": "%{JS: Cpp.headerGuard('%{HdrFileName}')}" }, - { "key": "SharedDataInit", "value": "%{JS: ('%{IncludeQSharedData}') ? 'data(new %{CN}Data)' : '' }" } + { "key": "CN", "value": "%{JS: Cpp.className(value('Class'))}" }, + { "key": "Base", "value": "%{JS: value('BaseCB') === '' ? value('BaseEdit') : value('BaseCB')}" }, + { "key": "isQObject", "value": "%{JS: [ 'QObject', 'QWidget', 'QMainWindow', 'QDeclarativeItem', 'QQuickItem'].indexOf(value('Base')) >= 0 }" }, + { "key": "GUARD", "value": "%{JS: Cpp.headerGuard(value('HdrFileName'))}" }, + { "key": "SharedDataInit", "value": "%{JS: (value('IncludeQSharedData')) ? 'data(new %{CN}Data)' : '' }" } ], "pages": @@ -49,7 +49,7 @@ { "name": "BaseEdit", "type": "LineEdit", - "enabled": "%{JS: '%{BaseCB}' === ''}", + "enabled": "%{JS: value('BaseCB') === ''}", "mandatory": false, "data": { @@ -71,7 +71,7 @@ { "checkedValue": "QObject", "uncheckedValue": "", - "checked": "%{JS: '%{BaseCB}' === 'QObject'}" + "checked": "%{JS: value('BaseCB') === 'QObject'}" } }, { @@ -82,7 +82,7 @@ { "checkedValue": "QWidget", "uncheckedValue": "", - "checked": "%{JS: '%{BaseCB}' === 'QWidget'}" + "checked": "%{JS: value('BaseCB') === 'QWidget'}" } }, { @@ -93,7 +93,7 @@ { "checkedValue": "QMainWindow", "uncheckedValue": "", - "checked": "%{JS: '%{BaseCB}' === 'QMainWindow'}" + "checked": "%{JS: value('BaseCB') === 'QMainWindow'}" } }, { @@ -104,7 +104,7 @@ { "checkedValue": "QDeclarativeItem", "uncheckedValue": "", - "checked": "%{JS: '%{BaseCB}' === 'QDeclarativeItem'}" + "checked": "%{JS: value('BaseCB') === 'QDeclarativeItem'}" } }, { @@ -115,7 +115,7 @@ { "checkedValue": "QQuickItem", "uncheckedValue": "", - "checked": "%{JS: '%{BaseCB}' === 'QQuickItem'}" + "checked": "%{JS: value('BaseCB') === 'QQuickItem'}" } }, { @@ -139,14 +139,14 @@ "type": "LineEdit", "trDisplayName": "Header file:", "mandatory": true, - "data": { "trText": "%{JS: Cpp.classToFileName('%{Class}', '%{JS: Util.preferredSuffix('text/x-c++hdr')}')}" } + "data": { "trText": "%{JS: Cpp.classToFileName(value('Class'), Util.preferredSuffix('text/x-c++hdr'))}" } }, { "name": "SrcFileName", "type": "LineEdit", "trDisplayName": "Source file:", "mandatory": true, - "data": { "trText": "%{JS: Cpp.classToFileName('%{Class}', '%{JS: Util.preferredSuffix('text/x-c++src')}')}" } + "data": { "trText": "%{JS: Cpp.classToFileName(value('Class'), Util.preferredSuffix('text/x-c++src'))}" } }, { "name": "Path", diff --git a/share/qtcreator/templates/wizards/classes/itemmodel/wizard.json b/share/qtcreator/templates/wizards/classes/itemmodel/wizard.json index 8b4830ca32..1e0cd06e19 100644 --- a/share/qtcreator/templates/wizards/classes/itemmodel/wizard.json +++ b/share/qtcreator/templates/wizards/classes/itemmodel/wizard.json @@ -6,15 +6,15 @@ "trDescription": "Creates a Qt item model.", "trDisplayName": "Qt Item Model", "trDisplayCategory": "Qt", - "enabled": "%{JS: [ %{Plugins} ].indexOf('CppEditor') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('CppEditor') >= 0}", "options": [ { "key": "TargetPath", "value": "%{Path}" }, { "key": "HdrPath", "value": "%{Path}/%{HdrFileName}" }, { "key": "SrcPath", "value": "%{Path}/%{SrcFileName}" }, - { "key": "CN", "value": "%{JS: Cpp.className('%{Class}')}" }, - { "key": "GUARD", "value": "%{JS: Cpp.classToHeaderGuard('%{Class}', '%{JS: Util.preferredSuffix('text/x-c++hdr')}')}" } + { "key": "CN", "value": "%{JS: Cpp.className(value('Class'))}" }, + { "key": "GUARD", "value": "%{JS: Cpp.classToHeaderGuard(value('Class'), Util.preferredSuffix('text/x-c++hdr'))}" } ], "pages": @@ -92,14 +92,14 @@ "type": "LineEdit", "trDisplayName": "Header file:", "mandatory": true, - "data": { "trText": "%{JS: Cpp.classToFileName('%{Class}', '%{JS: Util.preferredSuffix('text/x-c++hdr')}')}" } + "data": { "trText": "%{JS: Cpp.classToFileName(value('Class'), Util.preferredSuffix('text/x-c++hdr'))}" } }, { "name": "SrcFileName", "type": "LineEdit", "trDisplayName": "Source file:", "mandatory": true, - "data": { "trText": "%{JS: Cpp.classToFileName('%{Class}', '%{JS: Util.preferredSuffix('text/x-c++src')}')}" } + "data": { "trText": "%{JS: Cpp.classToFileName(value('Class'), Util.preferredSuffix('text/x-c++src'))}" } }, { "name": "Path", @@ -131,7 +131,7 @@ { "source": "itemmodel.h", "target": "%{HdrPath}", - "condition": "%{JS: '%{Base}' === 'QAbstractItemModel'}", + "condition": "%{JS: value('Base') === 'QAbstractItemModel'}", "options": [ { "key": "Cpp:License:FileName", "value": "%{HdrFileName}" }, { "key": "Cpp:License:ClassName", "value": "%{CN}" } @@ -141,7 +141,7 @@ "source": "itemmodel.cpp", "target": "%{SrcPath}", "openInEditor": true, - "condition": "%{JS: '%{Base}' === 'QAbstractItemModel'}", + "condition": "%{JS: value('Base') === 'QAbstractItemModel'}", "options": [ { "key": "Cpp:License:FileName", "value": "%{SrcFileName}" }, { "key": "Cpp:License:ClassName", "value": "%{CN}" } @@ -150,7 +150,7 @@ { "source": "tablemodel.h", "target": "%{HdrPath}", - "condition": "%{JS: '%{Base}' === 'QAbstractTableModel'}", + "condition": "%{JS: value('Base') === 'QAbstractTableModel'}", "options": [ { "key": "Cpp:License:FileName", "value": "%{HdrFileName}" }, { "key": "Cpp:License:ClassName", "value": "%{CN}" } @@ -160,7 +160,7 @@ "source": "tablemodel.cpp", "target": "%{SrcPath}", "openInEditor": true, - "condition": "%{JS: '%{Base}' === 'QAbstractTableModel'}", + "condition": "%{JS: value('Base') === 'QAbstractTableModel'}", "options": [ { "key": "Cpp:License:FileName", "value": "%{SrcFileName}" }, { "key": "Cpp:License:ClassName", "value": "%{CN}" } @@ -169,7 +169,7 @@ { "source": "listmodel.h", "target": "%{HdrPath}", - "condition": "%{JS: '%{Base}' === 'QAbstractListModel'}", + "condition": "%{JS: value('Base') === 'QAbstractListModel'}", "options": [ { "key": "Cpp:License:FileName", "value": "%{HdrFileName}" }, { "key": "Cpp:License:ClassName", "value": "%{CN}" } @@ -179,7 +179,7 @@ "source": "listmodel.cpp", "target": "%{SrcPath}", "openInEditor": true, - "condition": "%{JS: '%{Base}' === 'QAbstractListModel'}", + "condition": "%{JS: value('Base') === 'QAbstractListModel'}", "options": [ { "key": "Cpp:License:FileName", "value": "%{SrcFileName}" }, { "key": "Cpp:License:ClassName", "value": "%{CN}" } diff --git a/share/qtcreator/templates/wizards/classes/python/wizard.json b/share/qtcreator/templates/wizards/classes/python/wizard.json index 56a8d419e7..233a8bac7a 100644 --- a/share/qtcreator/templates/wizards/classes/python/wizard.json +++ b/share/qtcreator/templates/wizards/classes/python/wizard.json @@ -7,11 +7,11 @@ "trDisplayName": "Python Class", "trDisplayCategory": "Python", "icon": "../../files/python/icon.png", - "enabled": "%{JS: [ %{Plugins} ].indexOf('PythonEditor') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('PythonEditor') >= 0}", "options": [ - { "key": "Base", "value":"%{JS: ( '%{BaseCB}' === '' ) ? '%{BaseEdit}' : '%{BaseCB}'}" }, + { "key": "Base", "value":"%{JS: value('BaseCB') === '' ? value('BaseEdit') : value('BaseCB')}" }, { "key": "Imports", "value": "%{ImportQtCore}%{ImportQtWidgets}%{ImportQtDeclarative}"} ], @@ -52,7 +52,7 @@ { "name": "BaseEdit", "type": "LineEdit", - "enabled": "%{JS: '%{BaseCB}' === ''}", + "enabled": "%{JS: value('BaseCB') === ''}", "mandatory": false, "data": { "trText": "%{BaseCB}" } }, @@ -71,7 +71,7 @@ { "checkedValue": "QtCore", "uncheckedValue": "", - "checked": "%{JS: '%{Base}' !== ''}" + "checked": "%{JS: value('Base') !== ''}" } }, { @@ -82,7 +82,7 @@ { "checkedValue": "QtWidgets", "uncheckedValue": "", - "checked": "%{JS: '%{Base}' === 'QWidget'}" + "checked": "%{JS: value('Base') === 'QWidget'}" } }, { @@ -93,7 +93,7 @@ { "checkedValue": "QtQuick", "uncheckedValue": "", - "checked": "%{JS: '%{Base}' === 'QQuickItem'}" + "checked": "%{JS: value('Base') === 'QQuickItem'}" } }, { @@ -108,7 +108,7 @@ "type": "LineEdit", "trDisplayName": "Source file:", "mandatory": true, - "data": { "trText": "%{JS: Util.fileName('%{Class}', '%{JS: Util.preferredSuffix('text/x-python')}')}" } + "data": { "trText": "%{JS: Util.fileName(value('Class'), Util.preferredSuffix('text/x-python'))}" } }, { "name": "TargetPath", diff --git a/share/qtcreator/templates/wizards/classes/qtquickui/wizard.json b/share/qtcreator/templates/wizards/classes/qtquickui/wizard.json index 3fc4ed23a9..e8bd200d75 100644 --- a/share/qtcreator/templates/wizards/classes/qtquickui/wizard.json +++ b/share/qtcreator/templates/wizards/classes/qtquickui/wizard.json @@ -8,7 +8,7 @@ "trDisplayCategory": "Qt", "iconText": "ui.qml", "featuresRequired": [ "QtSupport.Wizards.FeatureQtQuick.UiFiles" ], - "enabled": "%{JS: [ %{Plugins} ].indexOf('QmlJSEditor') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('QmlJSEditor') >= 0}", "options" : [ { "key": "QmlFile", "value": "%{Class}.%{JS: Util.preferredSuffix('text/x-qml')}" }, diff --git a/share/qtcreator/templates/wizards/files/cppheader/wizard.json b/share/qtcreator/templates/wizards/files/cppheader/wizard.json index 94718b35d4..efb0ea8119 100644 --- a/share/qtcreator/templates/wizards/files/cppheader/wizard.json +++ b/share/qtcreator/templates/wizards/files/cppheader/wizard.json @@ -7,9 +7,9 @@ "trDisplayName": "C++ Header File", "trDisplayCategory": "C++", "iconText": "h", - "enabled": "%{JS: [ %{Plugins} ].indexOf('CppEditor') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('CppEditor') >= 0}", - "options": { "key": "FileName", "value": "%{JS: Util.fileName('%{TargetPath}', '%{JS: Util.preferredSuffix('text/x-c++hdr')}')}" }, + "options": { "key": "FileName", "value": "%{JS: Util.fileName(value('TargetPath'), Util.preferredSuffix('text/x-c++hdr'))}" }, "pages" : [ @@ -33,7 +33,7 @@ "source": "file.h", "target": "%{FileName}", "openInEditor": true, - "options": { "key": "Cpp:License:FileName", "value": "%{JS: Util.fileName('%{FileName}')}" } + "options": { "key": "Cpp:License:FileName", "value": "%{JS: Util.fileName(value('FileName'))}" } } } ] diff --git a/share/qtcreator/templates/wizards/files/cppsource/wizard.json b/share/qtcreator/templates/wizards/files/cppsource/wizard.json index 88a2b8d7ef..775cd892ab 100644 --- a/share/qtcreator/templates/wizards/files/cppsource/wizard.json +++ b/share/qtcreator/templates/wizards/files/cppsource/wizard.json @@ -7,9 +7,9 @@ "trDisplayName": "C++ Source File", "trDisplayCategory": "C++", "iconText": "cpp", - "enabled": "%{JS: [ %{Plugins} ].indexOf('CppEditor') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('CppEditor') >= 0}", - "options": { "key": "FileName", "value": "%{JS: Util.fileName('%{TargetPath}', '%{JS: Util.preferredSuffix('text/x-c++src')}')}" }, + "options": { "key": "FileName", "value": "%{JS: Util.fileName(value('TargetPath'), Util.preferredSuffix('text/x-c++src'))}" }, "pages" : [ @@ -33,7 +33,7 @@ "source": "file.cpp", "target": "%{FileName}", "openInEditor": true, - "options": { "key": "Cpp:License:FileName", "value": "%{JS: Util.fileName('%{FileName}')}" } + "options": { "key": "Cpp:License:FileName", "value": "%{JS: Util.fileName(value('FileName'))}" } } } ] diff --git a/share/qtcreator/templates/wizards/files/form/file.ui b/share/qtcreator/templates/wizards/files/form/file.ui index d83113033f..1ee54204a8 100644 --- a/share/qtcreator/templates/wizards/files/form/file.ui +++ b/share/qtcreator/templates/wizards/files/form/file.ui @@ -1 +1 @@ -%{JS: [ %{FormContents} ].join('\n')}\ +%{FormContents} diff --git a/share/qtcreator/templates/wizards/files/form/wizard.json b/share/qtcreator/templates/wizards/files/form/wizard.json index b098ff6923..ec5fd422a3 100644 --- a/share/qtcreator/templates/wizards/files/form/wizard.json +++ b/share/qtcreator/templates/wizards/files/form/wizard.json @@ -7,12 +7,12 @@ "trDisplayName": "Qt Designer Form", "trDisplayCategory": "Qt", "iconText": "ui", - "enabled": "%{JS: [ %{Plugins} ].indexOf('Designer') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('Designer') >= 0}", "options": [ - { "key": "UiClass", "value": "%{JS: QtSupport.uiClassName([ %{FormContents} ].join('\\n'))}" }, + { "key": "UiClass", "value": "%{JS: QtSupport.uiClassName(value('FormContents'))}" }, { "key": "Extension", "value": "%{JS: Util.preferredSuffix('application/x-designer')}"}, - { "key": "InitialFileName", "value": "%{JS: Cpp.classToFileName('%{UiClass}', '%{Extension}') }" } + { "key": "InitialFileName", "value": "%{JS: Cpp.classToFileName(value('UiClass'), value('Extension')) }" } ], "pages": @@ -41,7 +41,7 @@ "data": { "source": "file.ui", - "target": "%{JS: Util.fileName('%{TargetPath}', '%{Extension}')}", + "target": "%{JS: Util.fileName(value('TargetPath'), value('Extension'))}", "openInEditor": true } } diff --git a/share/qtcreator/templates/wizards/files/glsl/gl/fragment/wizard.json b/share/qtcreator/templates/wizards/files/glsl/gl/fragment/wizard.json index 9f71526851..900e4f8f68 100644 --- a/share/qtcreator/templates/wizards/files/glsl/gl/fragment/wizard.json +++ b/share/qtcreator/templates/wizards/files/glsl/gl/fragment/wizard.json @@ -8,7 +8,7 @@ "trDisplayCategory": "GLSL", "iconText": "frag", "platformIndependent": true, - "enabled": "%{JS: [ %{Plugins} ].indexOf('GLSLEditor') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('GLSLEditor') >= 0}", "pages" : [ @@ -30,7 +30,7 @@ "data": { "source": "file.frag", - "target": "%{JS: Util.fileName('%{TargetPath}', '%{JS: Util.preferredSuffix('text/x-glsl-frag')}')}", + "target": "%{JS: Util.fileName(value('TargetPath'), Util.preferredSuffix('text/x-glsl-frag'))}", "openInEditor": true } } diff --git a/share/qtcreator/templates/wizards/files/glsl/gl/vertex/wizard.json b/share/qtcreator/templates/wizards/files/glsl/gl/vertex/wizard.json index a8024cf059..38d2df2947 100644 --- a/share/qtcreator/templates/wizards/files/glsl/gl/vertex/wizard.json +++ b/share/qtcreator/templates/wizards/files/glsl/gl/vertex/wizard.json @@ -8,7 +8,7 @@ "trDisplayCategory": "GLSL", "iconText": "vert", "platformIndependent": true, - "enabled": "%{JS: [ %{Plugins} ].indexOf('GLSLEditor') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('GLSLEditor') >= 0}", "pages" : [ @@ -30,7 +30,7 @@ "data": { "source": "file.vert", - "target": "%{JS: Util.fileName('%{TargetPath}', '%{JS: Util.preferredSuffix('text/x-glsl-vert')}')}", + "target": "%{JS: Util.fileName(value('TargetPath'), Util.preferredSuffix('text/x-glsl-vert'))}", "openInEditor": true } } diff --git a/share/qtcreator/templates/wizards/files/glsl/gles/fragment/wizard.json b/share/qtcreator/templates/wizards/files/glsl/gles/fragment/wizard.json index bbaf2d0129..a993a3cfce 100644 --- a/share/qtcreator/templates/wizards/files/glsl/gles/fragment/wizard.json +++ b/share/qtcreator/templates/wizards/files/glsl/gles/fragment/wizard.json @@ -8,7 +8,7 @@ "trDisplayCategory": "GLSL", "iconText": "fsh", "platformIndependent": true, - "enabled": "%{JS: [ %{Plugins} ].indexOf('GLSLEditor') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('GLSLEditor') >= 0}", "pages" : [ @@ -30,7 +30,7 @@ "data": { "source": "file.fsh", - "target": "%{JS: Util.fileName('%{TargetPath}', '%{JS: Util.preferredSuffix('text/x-glsl-es-frag')}')}", + "target": "%{JS: Util.fileName(value('TargetPath'), Util.preferredSuffix('text/x-glsl-es-frag'))}", "openInEditor": true } } diff --git a/share/qtcreator/templates/wizards/files/glsl/gles/vertex/wizard.json b/share/qtcreator/templates/wizards/files/glsl/gles/vertex/wizard.json index 59865e7b55..54231aadd5 100644 --- a/share/qtcreator/templates/wizards/files/glsl/gles/vertex/wizard.json +++ b/share/qtcreator/templates/wizards/files/glsl/gles/vertex/wizard.json @@ -8,7 +8,7 @@ "trDisplayCategory": "GLSL", "iconText": "vsh", "platformIndependent": true, - "enabled": "%{JS: [ %{Plugins} ].indexOf('GLSLEditor') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('GLSLEditor') >= 0}", "pages" : [ @@ -30,7 +30,7 @@ "data": { "source": "file.vsh", - "target": "%{JS: Util.fileName('%{TargetPath}', '%{JS: Util.preferredSuffix('text/x-glsl-es-vert')}')}", + "target": "%{JS: Util.fileName(value('TargetPath'), Util.preferredSuffix('text/x-glsl-es-vert'))}", "openInEditor": true } } diff --git a/share/qtcreator/templates/wizards/files/java/wizard.json b/share/qtcreator/templates/wizards/files/java/wizard.json index 427dc84e16..b3e4131d1a 100644 --- a/share/qtcreator/templates/wizards/files/java/wizard.json +++ b/share/qtcreator/templates/wizards/files/java/wizard.json @@ -7,9 +7,9 @@ "trDisplayName": "Java File", "trDisplayCategory": "Java", "iconText": "java", - "enabled": "%{JS: [ %{Plugins} ].indexOf('Android') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('Android') >= 0}", - "options": [ { "key": "ClassName", "value": "%{JS: '%{FileName}'.charAt(0).toUpperCase() + '%{FileName}'.substr(1)}" } ], + "options": [ { "key": "ClassName", "value": "%{JS: value('FileName').charAt(0).toUpperCase() + value('FileName').substr(1)}" } ], "pages" : [ @@ -31,7 +31,7 @@ "data": { "source": "source.java", - "target": "%{JS: Util.fileName('%{Path}/%{ClassName}', '%{JS: Util.preferredSuffix('text/x-java')}')}", + "target": "%{JS: Util.fileName(value('Path') + '/' + value('ClassName'), Util.preferredSuffix('text/x-java'))}", "openInEditor": true } } diff --git a/share/qtcreator/templates/wizards/files/js/wizard.json b/share/qtcreator/templates/wizards/files/js/wizard.json index 62d3211cda..d47721bb46 100644 --- a/share/qtcreator/templates/wizards/files/js/wizard.json +++ b/share/qtcreator/templates/wizards/files/js/wizard.json @@ -7,7 +7,7 @@ "trDisplayName": "JS File", "trDisplayCategory": "Qt", "iconText": "js", - "enabled": "%{JS: [ %{Plugins} ].indexOf('QmlJSEditor') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('QmlJSEditor') >= 0}", "pages" : [ @@ -47,7 +47,7 @@ "data": { "source": "file.js", - "target": "%{JS: Util.fileName('%{TargetPath}', '%{JS: Util.preferredSuffix('application/javascript')}')}", + "target": "%{JS: Util.fileName(value('TargetPath'), Util.preferredSuffix('application/javascript'))}", "openInEditor": true } } diff --git a/share/qtcreator/templates/wizards/files/modeling/model/wizard.json b/share/qtcreator/templates/wizards/files/modeling/model/wizard.json index b2d9029c74..c971c8bf9d 100644 --- a/share/qtcreator/templates/wizards/files/modeling/model/wizard.json +++ b/share/qtcreator/templates/wizards/files/modeling/model/wizard.json @@ -8,12 +8,12 @@ "trDisplayCategory": "Modeling", "iconText": "qmodel", "platformIndependent": true, - "enabled": "%{JS: [ %{Plugins} ].indexOf('ModelEditor') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('ModelEditor') >= 0}", "options": [ - { "key": "TargetPath", "value": "%{JS: Util.fileName('%{Location}/%{FileName}', '%{JS: Util.preferredSuffix('text/vnd.qtcreator.model')}')}" }, - { "key": "FileName", "value": "%{JS: Modeling.elementNameToFileName('%{Name}')}" } + { "key": "TargetPath", "value": "%{JS: Util.fileName(value('Location') + '/' + value('FileName'), Util.preferredSuffix('text/vnd.qtcreator.model'))}" }, + { "key": "FileName", "value": "%{JS: Modeling.elementNameToFileName(value('Name'))}" } ], "pages" : @@ -34,8 +34,8 @@ "name": "Location", "trDisplayName": "Location:", "type": "PathChooser", - "isComplete": "%{JS: '%{Location}' === '' || !Util.exists('%{TargetPath}')}", - "trIncompleteMessage": "\"%{JS: Util.toNativeSeparators('%{TargetPath}')}\" exists in the filesystem.", + "isComplete": "%{JS: value('Location') === '' || !Util.exists(value('TargetPath'))}", + "trIncompleteMessage": "\"%{JS: Util.toNativeSeparators(value('TargetPath'))}\" exists in the filesystem.", "data": { "kind": "directory", diff --git a/share/qtcreator/templates/wizards/files/modeling/scratch/wizard.json b/share/qtcreator/templates/wizards/files/modeling/scratch/wizard.json index 71bad75ddf..8092ba6021 100644 --- a/share/qtcreator/templates/wizards/files/modeling/scratch/wizard.json +++ b/share/qtcreator/templates/wizards/files/modeling/scratch/wizard.json @@ -8,7 +8,7 @@ "trDisplayCategory": "Modeling", "iconText": "qmodel", "platformIndependent": true, - "enabled": "%{JS: [ %{Plugins} ].indexOf('ModelEditor') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('ModelEditor') >= 0}", "options": [ { "key": "TargetPath", "value": "%{JS: Util.mktemp('model-XXXXXX.qmodel')}" } ], diff --git a/share/qtcreator/templates/wizards/files/nim/wizard.json b/share/qtcreator/templates/wizards/files/nim/wizard.json index 953df6a847..723531ced5 100644 --- a/share/qtcreator/templates/wizards/files/nim/wizard.json +++ b/share/qtcreator/templates/wizards/files/nim/wizard.json @@ -7,7 +7,7 @@ "trDisplayName": "Nim File", "trDisplayCategory": "Nim", "icon": "../../projects/nim/icon.png", - "enabled": "%{JS: [ %{Plugins} ].indexOf('Nim') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('Nim') >= 0}", "pages" : [ @@ -29,7 +29,7 @@ "data": { "source": "file.nim", - "target": "%{JS: Util.fileName('%{TargetPath}', 'nim')}", + "target": "%{JS: Util.fileName(value('TargetPath'), 'nim')}", "openInEditor": true } } diff --git a/share/qtcreator/templates/wizards/files/nimscript/wizard.json b/share/qtcreator/templates/wizards/files/nimscript/wizard.json index 62aba314cd..15f366773b 100644 --- a/share/qtcreator/templates/wizards/files/nimscript/wizard.json +++ b/share/qtcreator/templates/wizards/files/nimscript/wizard.json @@ -7,7 +7,7 @@ "trDisplayName": "Nim Script File", "trDisplayCategory": "Nim", "icon": "../../projects/nim/icon.png", - "enabled": "%{JS: [ %{Plugins} ].indexOf('Nim') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('Nim') >= 0}", "pages" : [ @@ -29,7 +29,7 @@ "data": { "source": "file.nims", - "target": "%{JS: Util.fileName('%{TargetPath}', 'nims')}", + "target": "%{JS: Util.fileName(value('TargetPath'), 'nims')}", "openInEditor": true } } diff --git a/share/qtcreator/templates/wizards/files/python/wizard.json b/share/qtcreator/templates/wizards/files/python/wizard.json index d4a6cfd012..262de2d37b 100644 --- a/share/qtcreator/templates/wizards/files/python/wizard.json +++ b/share/qtcreator/templates/wizards/files/python/wizard.json @@ -7,7 +7,7 @@ "trDisplayName": "Python File", "trDisplayCategory": "Python", "icon": "icon.png", - "enabled": "%{JS: [ %{Plugins} ].indexOf('PythonEditor') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('PythonEditor') >= 0}", "pages" : [ @@ -29,7 +29,7 @@ "data": { "source": "file.py", - "target": "%{JS: Util.fileName('%{TargetPath}', '%{JS: Util.preferredSuffix('text/x-python')}')}", + "target": "%{JS: Util.fileName(value('TargetPath'), Util.preferredSuffix('text/x-python'))}", "openInEditor": true } } diff --git a/share/qtcreator/templates/wizards/files/qrc/wizard.json b/share/qtcreator/templates/wizards/files/qrc/wizard.json index ccf8a4fea8..578eed58a1 100644 --- a/share/qtcreator/templates/wizards/files/qrc/wizard.json +++ b/share/qtcreator/templates/wizards/files/qrc/wizard.json @@ -7,7 +7,7 @@ "trDisplayName": "Qt Resource File", "trDisplayCategory": "Qt", "iconText": "qrc", - "enabled": "%{JS: [ %{Plugins} ].indexOf('ResourceEditor') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('ResourceEditor') >= 0}", "pages" : [ @@ -29,7 +29,7 @@ "data": { "source": "file.qrc", - "target": "%{JS: Util.fileName('%{TargetPath}', '%{JS: Util.preferredSuffix('application/vnd.qt.xml.resource')}')}", + "target": "%{JS: Util.fileName(value('TargetPath'), Util.preferredSuffix('application/vnd.qt.xml.resource'))}", "openInEditor": true } } diff --git a/share/qtcreator/templates/wizards/files/qtquick2/wizard.json b/share/qtcreator/templates/wizards/files/qtquick2/wizard.json index 544368b173..ead52b1687 100644 --- a/share/qtcreator/templates/wizards/files/qtquick2/wizard.json +++ b/share/qtcreator/templates/wizards/files/qtquick2/wizard.json @@ -7,7 +7,7 @@ "trDisplayName": "QML File (Qt Quick 2)", "trDisplayCategory": "Qt", "iconText": "qml", - "enabled": "%{JS: [ %{Plugins} ].indexOf('QmlJSEditor') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('QmlJSEditor') >= 0}", "pages" : [ @@ -29,7 +29,7 @@ "data": { "source": "file.qml.tpl", - "target": "%{JS: Util.fileName('%{TargetPath}', '%{JS: Util.preferredSuffix('text/x-qml')}')}", + "target": "%{JS: Util.fileName(value('TargetPath'), Util.preferredSuffix('text/x-qml'))}", "openInEditor": true } } diff --git a/share/qtcreator/templates/wizards/files/scratch/wizard.json b/share/qtcreator/templates/wizards/files/scratch/wizard.json index 6508db6aa3..aa0efb0e10 100644 --- a/share/qtcreator/templates/wizards/files/scratch/wizard.json +++ b/share/qtcreator/templates/wizards/files/scratch/wizard.json @@ -7,7 +7,7 @@ "trDisplayName": "Scratch Buffer", "trDisplayCategory": "General", "platformIndependent": true, - "enabled": "%{JS: [ %{Plugins} ].indexOf('TextEditor') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('TextEditor') >= 0}", "options": [ { "key": "TargetPath", "value": "%{JS: Util.mktemp('scratch-XXXXXX.txt')}" } ], diff --git a/share/qtcreator/templates/wizards/files/scxml/wizard.json b/share/qtcreator/templates/wizards/files/scxml/wizard.json index 4c150c6256..36bbda7b71 100644 --- a/share/qtcreator/templates/wizards/files/scxml/wizard.json +++ b/share/qtcreator/templates/wizards/files/scxml/wizard.json @@ -8,11 +8,11 @@ "trDisplayCategory": "Modeling", "iconText": "scxml", "platformIndependent": true, - "enabled": "%{JS: [ %{Plugins} ].indexOf('ScxmlEditor') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('ScxmlEditor') >= 0}", "options": [ - { "key": "TargetPath", "value": "%{JS: Util.fileName('%{Location}/%{FileName}', '%{JS: Util.preferredSuffix('application/scxml+xml')}')}" }, + { "key": "TargetPath", "value": "%{JS: Util.fileName(value('Location') + '/' + value('FileName'), Util.preferredSuffix('application/scxml+xml'))}" }, { "key": "FileName", "value": "%{Name}" } ], @@ -34,8 +34,8 @@ "name": "Location", "trDisplayName": "Location:", "type": "PathChooser", - "isComplete": "%{JS: '%{Location}' === '' || !Util.exists('%{TargetPath}')}", - "trIncompleteMessage": "\"%{JS: Util.toNativeSeparators('%{TargetPath}')}\" exists in the filesystem.", + "isComplete": "%{JS: value('Location') === '' || !Util.exists(value('TargetPath'))}", + "trIncompleteMessage": "\"%{JS: Util.toNativeSeparators(value('TargetPath'))}\" exists in the filesystem.", "data": { "kind": "directory", diff --git a/share/qtcreator/templates/wizards/files/text/wizard.json b/share/qtcreator/templates/wizards/files/text/wizard.json index 11e0577a2d..b983401ef3 100644 --- a/share/qtcreator/templates/wizards/files/text/wizard.json +++ b/share/qtcreator/templates/wizards/files/text/wizard.json @@ -8,7 +8,7 @@ "trDisplayCategory": "General", "iconText": "txt", "platformIndependent": true, - "enabled": "%{JS: [ %{Plugins} ].indexOf('TextEditor') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('TextEditor') >= 0}", "pages" : [ diff --git a/share/qtcreator/templates/wizards/projects/consoleapp/wizard.json b/share/qtcreator/templates/wizards/projects/consoleapp/wizard.json index b40d529169..bee602c87d 100644 --- a/share/qtcreator/templates/wizards/projects/consoleapp/wizard.json +++ b/share/qtcreator/templates/wizards/projects/consoleapp/wizard.json @@ -8,13 +8,13 @@ "trDisplayCategory": "Application", "icon": "../../global/consoleapplication.png", "featuresRequired": [ "QtSupport.Wizards.FeatureQt" ], - "enabled": "%{JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0 || [ %{Plugins} ].indexOf('QbsProjectManager') >= 0 || [ %{Plugins} ].indexOf('CMakeProjectManager') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('QmakeProjectManager') >= 0 || value('Plugins').indexOf('QbsProjectManager') >= 0 || value('Plugins').indexOf('CMakeProjectManager') >= 0}", "options": [ - { "key": "ProjectFile", "value": "%{JS: '%{BuildSystem}' === 'qmake' ? '%{ProFile}' : ('%{BuildSystem}' === 'cmake' ? '%{CMakeFile}' : '%{QbsFile}')}" }, - { "key": "ProFile", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'pro')}" }, - { "key": "QbsFile", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'qbs')}" }, + { "key": "ProjectFile", "value": "%{JS: value('BuildSystem') === 'qmake' ? value('ProFile') : (value('BuildSystem') === 'cmake' ? value('CMakeFile') : value('QbsFile'))}" }, + { "key": "ProFile", "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'pro')}" }, + { "key": "QbsFile", "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'qbs')}" }, { "key": "CMakeFile", "value": "%{ProjectDirectory}/CMakeLists.txt" }, { "key": "CppFileName", "value": "%{JS: 'main.' + Util.preferredSuffix('text/x-c++src')}" } ], @@ -31,7 +31,7 @@ "trDisplayName": "Define Build System", "trShortTitle": "Build System", "typeId": "Fields", - "enabled": "%{JS: ! %{IsSubproject}}", + "enabled": "%{JS: !value('IsSubproject')}", "data": [ { @@ -46,17 +46,17 @@ { "trKey": "qmake", "value": "qmake", - "condition": "%{JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0}" + "condition": "%{JS: value('Plugins').indexOf('QmakeProjectManager') >= 0}" }, { "trKey": "CMake", "value": "cmake", - "condition": "%{JS: [ %{Plugins} ].indexOf('CMakeProjectManager') >= 0}" + "condition": "%{JS: value('Plugins').indexOf('CMakeProjectManager') >= 0}" }, { "trKey": "Qbs", "value": "qbs", - "condition": "%{JS: [ %{Plugins} ].indexOf('QbsProjectManager') >= 0}" + "condition": "%{JS: value('Plugins').indexOf('QbsProjectManager') >= 0}" } ] } @@ -67,7 +67,7 @@ "trDisplayName": "Kit Selection", "trShortTitle": "Kits", "typeId": "Kits", - "enabled": "%{JS: ! %{IsSubproject}}", + "enabled": "%{JS: !value('IsSubproject')}", "data": { "projectFilePath": "%{ProjectFile}" } }, { @@ -86,18 +86,18 @@ "source": "file.pro", "target": "%{ProFile}", "openAsProject": true, - "condition": "%{JS: '%{BuildSystem}' === 'qmake'}" + "condition": "%{JS: value('BuildSystem') === 'qmake'}" }, { "source": "CMakeLists.txt", "openAsProject": true, - "condition": "%{JS: '%{BuildSystem}' === 'cmake'}" + "condition": "%{JS: value('BuildSystem') === 'cmake'}" }, { "source": "file.qbs", "target": "%{QbsFile}", "openAsProject": true, - "condition": "%{JS: '%{BuildSystem}' === 'qbs'}" + "condition": "%{JS: value('BuildSystem') === 'qbs'}" }, { "source": "main.cpp", @@ -107,7 +107,7 @@ { "source": "../git.ignore", "target": ".gitignore", - "condition": "%{JS: ! %{IsSubproject} && '%{VersionControl}' === 'G.Git'}" + "condition": "%{JS: !value('IsSubproject') && value('VersionControl') === 'G.Git'}" } ] } diff --git a/share/qtcreator/templates/wizards/projects/cpplibrary/wizard.json b/share/qtcreator/templates/wizards/projects/cpplibrary/wizard.json index e1d58c25e7..ea455be4a2 100644 --- a/share/qtcreator/templates/wizards/projects/cpplibrary/wizard.json +++ b/share/qtcreator/templates/wizards/projects/cpplibrary/wizard.json @@ -7,31 +7,31 @@ "trDisplayName": "C++ Library", "trDisplayCategory": "Library", "icon": "../../global/lib.png", - "enabled": "%{JS: [ %{Plugins} ].indexOf('CppEditor') >= 0 && ([ %{Plugins} ].indexOf('QmakeProjectManager') >= 0 || [ %{Plugins} ].indexOf('CMakeProjectManager') >= 0)}", + "enabled": "%{JS: value('Plugins').indexOf('CppEditor') >= 0 && (value('Plugins').indexOf('QmakeProjectManager') >= 0 || value('Plugins').indexOf('CMakeProjectManager') >= 0)}", "options": [ - { "key": "ProjectFile", "value": "%{JS: '%{BuildSystem}' === 'qmake' ? '%{ProFile}' : '%{CMakeFile}'}" }, - { "key": "ProFile", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'pro')}" }, + { "key": "ProjectFile", "value": "%{JS: value('BuildSystem') === 'qmake' ? value('ProFile') : value('CMakeFile')}" }, + { "key": "ProFile", "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'pro')}" }, { "key": "CMakeFile", "value": "%{ProjectDirectory}/CMakeLists.txt" }, - { "key": "PluginJsonFile", "value": "%{JS: Util.fileName('%{ProjectName}', 'json')}" }, - { "key": "IsShared", "value": "%{JS: '%{Type}' === 'shared'}" }, - { "key": "IsStatic", "value": "%{JS: '%{Type}' === 'static'}" }, - { "key": "IsQtPlugin", "value": "%{JS: '%{Type}' === 'qtplugin'}" }, - { "key": "BaseClassName", "value": "%{JS: [%{BaseClassInfo}].length ? [%{BaseClassInfo}][0] : ''}" }, - { "key": "PluginTargetPath", "value": "%{JS: [%{BaseClassInfo}].length ? [%{BaseClassInfo}][1] : ''}" }, - { "key": "PluginInterface", "value": "%{JS: [%{BaseClassInfo}].length ? [%{BaseClassInfo}][2] : ''}" }, - { "key": "PluginModule", "value": "%{JS: [%{BaseClassInfo}].length ? [%{BaseClassInfo}][3] : ''}" }, - { "key": "PluginMethods", "value": "%{JS: [%{BaseClassInfo}].length ? [%{BaseClassInfo}][4] : ''}" }, - { "key": "QtModule", "value": "%{JS: %{IsQtPlugin} ? '%{PluginModule}' : '%{LibraryQtModule}'}" }, - { "key": "QtModuleUpperCase", "value": "%{JS: '%{QtModule}'.charAt(0).toUpperCase() + '%{QtModule}'.slice(1)}" }, - { "key": "LibraryDefine", "value": "%{JS: Cpp.headerGuard('%{ProjectName}') + '_LIBRARY'}" }, - { "key": "LibraryExport", "value": "%{JS: Cpp.headerGuard('%{ProjectName}') + '_EXPORT'}" }, - { "key": "GlobalHdrFileName", "value": "%{JS: Util.fileName('%{ProjectName}_global', Util.preferredSuffix('text/x-c++hdr'))}" }, - { "key": "TargetInstallPath", "value": "%{JS: %{IsShared} ? '/usr/lib' : (%{IsQtPlugin} && '%{PluginTargetPath}' ? '$$[QT_INSTALL_PLUGINS]/%{PluginTargetPath}' : '')}" }, - { "key": "CN", "value": "%{JS: Cpp.className('%{Class}')}" }, - { "key": "GUARD", "value": "%{JS: Cpp.headerGuard('%{HdrFileName}')}" }, - { "key": "GLOBAL_GUARD", "value": "%{JS: Cpp.headerGuard('%{GlobalHdrFileName}')}" } + { "key": "PluginJsonFile", "value": "%{JS: Util.fileName(value('ProjectName'), 'json')}" }, + { "key": "IsShared", "value": "%{JS: value('Type') === 'shared'}" }, + { "key": "IsStatic", "value": "%{JS: value('Type') === 'static'}" }, + { "key": "IsQtPlugin", "value": "%{JS: value('Type') === 'qtplugin'}" }, + { "key": "BaseClassName", "value": "%{JS: value('BaseClassInfo').BaseClassName }" }, + { "key": "PluginTargetPath", "value": "%{JS: value('BaseClassInfo').PluginTargetPath }" }, + { "key": "PluginInterface", "value": "%{JS: value('BaseClassInfo').PluginInterface }" }, + { "key": "PluginModule", "value": "%{JS: value('BaseClassInfo').PluginModule }" }, + { "key": "PluginMethods", "value": "%{JS: value('BaseClassInfo').PluginMethods }" }, + { "key": "QtModule", "value": "%{JS: value('IsQtPlugin') ? value('PluginModule') : value('LibraryQtModule')}" }, + { "key": "QtModuleUpperCase", "value": "%{JS: value('QtModule').charAt(0).toUpperCase() + value('QtModule').slice(1)}" }, + { "key": "LibraryDefine", "value": "%{JS: Cpp.headerGuard(value('ProjectName')) + '_LIBRARY'}" }, + { "key": "LibraryExport", "value": "%{JS: Cpp.headerGuard(value('ProjectName')) + '_EXPORT'}" }, + { "key": "GlobalHdrFileName", "value": "%{JS: Util.fileName(value('ProjectName') + '_global', Util.preferredSuffix('text/x-c++hdr'))}" }, + { "key": "TargetInstallPath", "value": "%{JS: value('IsShared') ? '/usr/lib' : (value('IsQtPlugin') && value('PluginTargetPath') ? '$$[QT_INSTALL_PLUGINS]/' + value('PluginTargetPath') : '')}" }, + { "key": "CN", "value": "%{JS: Cpp.className(value('Class'))}" }, + { "key": "GUARD", "value": "%{JS: Cpp.headerGuard(value('HdrFileName'))}" }, + { "key": "GLOBAL_GUARD", "value": "%{JS: Cpp.headerGuard(value('GlobalHdrFileName'))}" } ], "pages": @@ -46,7 +46,7 @@ "trDisplayName": "Define Build System", "trShortTitle": "Build System", "typeId": "Fields", - "enabled": "%{JS: ! %{IsSubproject}}", + "enabled": "%{JS: !value('IsSubproject')}", "data": [ { @@ -61,12 +61,12 @@ { "trKey": "Qmake", "value": "qmake", - "condition": "%{JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0}" + "condition": "%{JS: value('Plugins').indexOf('QmakeProjectManager') >= 0}" }, { "trKey": "CMake", "value": "cmake", - "condition": "%{JS: [ %{Plugins} ].indexOf('CMakeProjectManager') >= 0}" + "condition": "%{JS: value('Plugins').indexOf('CMakeProjectManager') >= 0}" } ] } @@ -124,14 +124,14 @@ "data": { "validator": "(?:(?:[a-zA-Z_][a-zA-Z_0-9]*::)*[a-zA-Z_][a-zA-Z_0-9]*|)", - "trText": "%{JS: '%{Type}' === 'qtplugin' ? '%{BaseClassName}'.slice(1) : ('%{ProjectName}'.charAt(0).toUpperCase() + '%{ProjectName}'.slice(1))}" + "trText": "%{JS: value('Type') === 'qtplugin' ? value('BaseClassName').slice(1) : (value('ProjectName').charAt(0).toUpperCase() + value('ProjectName').slice(1))}" } }, { "name": "BaseClassInfo", "trDisplayName": "Base class:", "type": "ComboBox", - "visible": "%{JS: '%{Type}' === 'qtplugin'}", + "visible": "%{JS: value('Type') === 'qtplugin'}", "data": { "index": 1, @@ -139,31 +139,80 @@ [ { "trKey": "QAccessiblePlugin", - "value": "'QAccessiblePlugin', 'accessible', 'QAccessibleFactoryInterface', 'gui', 'QAccessibleInterface *create(const QString &key, QObject *object)'" + "value": + { + "BaseClassName": "QAccessiblePlugin", + "PluginTargetPath": "accessible", + "PluginInterface": "QAccessibleFactoryInterface", + "PluginModule": "gui", + "PluginMethods": "QAccessibleInterface *create(const QString &key, QObject *object)" + } }, { "trKey": "QGenericPlugin", - "value": "'QGenericPlugin', 'generic', 'QGenericPluginFactoryInterface', 'gui', 'QObject *create(const QString &name, const QString &spec)'" + "value": + { + "BaseClassName": "QGenericPlugin", + "PluginTargetPath": "generic", + "PluginInterface": "QGenericPluginFactoryInterface", + "PluginModule": "gui", + "PluginMethods": "QObject *create(const QString &name, const QString &spec)" + } }, { "trKey": "QIconEnginePlugin", - "value": "'QIconEnginePlugin', 'imageformats', 'QIconEngineFactoryInterface', 'gui', 'QIconEngine *create(const QString &filename)'" + "value": + { + "BaseClassName": "QIconEnginePlugin", + "PluginTargetPath": "imageformats", + "PluginInterface": "QIconEngineFactoryInterface", + "PluginModule": "gui", + "PluginMethods": "QIconEngine *create(const QString &filename)" + } }, { "trKey": "QImageIOPlugin", - "value": "'QImageIOPlugin', 'imageformats', 'QImageIOHandlerFactoryInterface', 'gui', 'QImageIOPlugin::Capabilities capabilities(QIODevice *device, const QByteArray &format) const|QImageIOHandler *create(QIODevice *device, const QByteArray &format) const'" + "value": + { + "BaseClassName": "QImageIOPlugin", + "PluginTargetPath": "imageformats", + "PluginInterface": "QImageIOHandlerFactoryInterface", + "PluginModule": "gui", + "PluginMethods": "QImageIOPlugin::Capabilities capabilities(QIODevice *device, const QByteArray &format) const|QImageIOHandler *create(QIODevice *device, const QByteArray &format) const" + } }, { "trKey": "QScriptExtensionPlugin", - "value": "'QScriptExtensionPlugin', '', 'QScriptExtensionInterface', 'script', 'void initialize(const QString &key, QScriptEngine *engine)|QStringList keys() const'" + "value": + { + "BaseClassName": "QScriptExtensionPlugin", + "PluginTargetPath": "", + "PluginInterface": "QScriptExtensionInterface", + "PluginModule": "script", + "PluginMethods": "void initialize(const QString &key, QScriptEngine *engine)|QStringList keys() const" + } }, { "trKey": "QSqlDriverPlugin", - "value": "'QSqlDriverPlugin', 'sqldrivers', 'QSqlDriverFactoryInterface', 'sql', 'QSqlDriver *create(const QString &key)'" + "value": + { + "BaseClassName": "QSqlDriverPlugin", + "PluginTargetPath": "sqldrivers", + "PluginInterface": "QSqlDriverFactoryInterface", + "PluginModule": "sql", + "PluginMethods": "QSqlDriver *create(const QString &key)" + } }, { "trKey": "QStylePlugin", - "value": "'QStylePlugin', 'styles', 'QStyleFactoryInterface', 'widgets', 'QStyle *create(const QString &key)'" + "value": + { + "BaseClassName": "QStylePlugin", + "PluginTargetPath": "styles", + "PluginInterface": "QStyleFactoryInterface", + "PluginModule": "widgets", + "PluginMethods": "QStyle *create(const QString &key)" + } } ] } @@ -172,7 +221,7 @@ "name": "LibraryQtModule", "trDisplayName": "Qt module:", "type": "ComboBox", - "visible": "%{JS: '%{Type}' != 'qtplugin'}", + "visible": "%{JS: value('Type') != 'qtplugin'}", "data": { "index": 1, @@ -206,14 +255,14 @@ "type": "LineEdit", "trDisplayName": "Header file:", "mandatory": true, - "data": { "trText": "%{JS: Cpp.classToFileName('%{Class}', '%{JS: Util.preferredSuffix('text/x-c++hdr')}')}" } + "data": { "trText": "%{JS: Cpp.classToFileName(value('Class'), Util.preferredSuffix('text/x-c++hdr'))}" } }, { "name": "SrcFileName", "type": "LineEdit", "trDisplayName": "Source file:", "mandatory": true, - "data": { "trText": "%{JS: Cpp.classToFileName('%{Class}', '%{JS: Util.preferredSuffix('text/x-c++src')}')}" } + "data": { "trText": "%{JS: Cpp.classToFileName(value('Class'), Util.preferredSuffix('text/x-c++src'))}" } } ] }, @@ -221,7 +270,7 @@ "trDisplayName": "Kit Selection", "trShortTitle": "Kits", "typeId": "Kits", - "enabled": "%{JS: ! %{IsSubproject}}", + "enabled": "%{JS: !value('IsSubproject')}", "data": { "projectFilePath": "%{ProjectFile}" } }, { @@ -240,12 +289,12 @@ "source": "project.pro", "target": "%{ProFile}", "openAsProject": true, - "condition": "%{JS: '%{BuildSystem}' === 'qmake'}" + "condition": "%{JS: value('BuildSystem') === 'qmake'}" }, { "source": "CMakeLists.txt", "openAsProject": true, - "condition": "%{JS: '%{BuildSystem}' === 'cmake'}" + "condition": "%{JS: value('BuildSystem') === 'cmake'}" }, { "source": "lib.cpp", @@ -259,17 +308,17 @@ { "source": "lib_global.h", "target": "%{GlobalHdrFileName}", - "condition": "%{JS: '%{Type}' === 'shared'}" + "condition": "%{JS: value('Type') === 'shared'}" }, { "source": "project.json", "target": "%{PluginJsonFile}", - "condition": "%{JS: '%{Type}' === 'qtplugin'}" + "condition": "%{JS: value('Type') === 'qtplugin'}" }, { "source": "../git.ignore", "target": ".gitignore", - "condition": "%{JS: ! %{IsSubproject} && '%{VersionControl}' === 'G.Git'}" + "condition": "%{JS: !value('IsSubproject') && value('VersionControl') === 'G.Git'}" } ] } diff --git a/share/qtcreator/templates/wizards/projects/nim/wizard.json b/share/qtcreator/templates/wizards/projects/nim/wizard.json index bd30370cd5..1239e444e9 100644 --- a/share/qtcreator/templates/wizards/projects/nim/wizard.json +++ b/share/qtcreator/templates/wizards/projects/nim/wizard.json @@ -8,13 +8,13 @@ "trDisplayCategory": "Non-Qt Project", "featuresRequired": [ "ToolChain.Nim.NimToolChain" ], "icon": "icon.png", - "enabled": "%{JS: [ %{Plugins} ].indexOf('Nim') >= 0 }", + "enabled": "%{JS: value('Plugins').indexOf('Nim') >= 0 }", "options": [ - { "key": "ProjectFile", "value": "%{JS: '%{NimProjectFile}'}" }, - { "key": "NimProjectFile", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'nimproject')}" }, - { "key": "NimFileName", "value": "%{JS: 'main.nim'}" } + { "key": "ProjectFile", "value": "%{NimProjectFile}" }, + { "key": "NimProjectFile", "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'nimproject')}" }, + { "key": "NimFileName", "value": "main.nim" } ], "pages": @@ -28,7 +28,7 @@ "trDisplayName": "Kit Selection", "trShortTitle": "Kits", "typeId": "Kits", - "enabled": "%{JS: ! %{IsSubproject}}", + "enabled": "%{JS: !value('IsSubproject')}", "data": { "projectFilePath": "%{ProjectFile}" } }, { @@ -56,7 +56,7 @@ { "source": "../git.ignore", "target": "%{ProjectDirectory}/.gitignore", - "condition": "%{JS: ! %{IsSubproject} && '%{VersionControl}' === 'G.Git'}" + "condition": "%{JS: !value('IsSubproject') && value('VersionControl') === 'G.Git'}" } ] } diff --git a/share/qtcreator/templates/wizards/projects/plainc/wizard.json b/share/qtcreator/templates/wizards/projects/plainc/wizard.json index 56361be81d..66514cb9a7 100644 --- a/share/qtcreator/templates/wizards/projects/plainc/wizard.json +++ b/share/qtcreator/templates/wizards/projects/plainc/wizard.json @@ -7,13 +7,13 @@ "trDisplayName": "Plain C Application", "trDisplayCategory": "Non-Qt Project", "icon": "../../global/consoleapplication.png", - "enabled": "%{JS: [ %{Plugins} ].indexOf('CppEditor') >= 0 && ([ %{Plugins} ].indexOf('QmakeProjectManager') >= 0 || [ %{Plugins} ].indexOf('QbsProjectManager') >= 0 || [ %{Plugins} ].indexOf('CMakeProjectManager') >= 0)}", + "enabled": "%{JS: value('Plugins').indexOf('CppEditor') >= 0 && (value('Plugins').indexOf('QmakeProjectManager') >= 0 || value('Plugins').indexOf('QbsProjectManager') >= 0 || value('Plugins').indexOf('CMakeProjectManager') >= 0)}", "options": [ - { "key": "ProjectFile", "value": "%{JS: '%{BuildSystem}' === 'qmake' ? '%{ProFile}' : ('%{BuildSystem}' === 'cmake' ? '%{CMakeFile}' : '%{QbsFile}')}" }, - { "key": "ProFile", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'pro')}" }, - { "key": "QbsFile", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'qbs')}" }, + { "key": "ProjectFile", "value": "%{JS: value('BuildSystem') === 'qmake' ? value('ProFile') : (value('BuildSystem') === 'cmake' ? value('CMakeFile') : value('QbsFile'))}" }, + { "key": "ProFile", "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'pro')}" }, + { "key": "QbsFile", "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'qbs')}" }, { "key": "CMakeFile", "value": "%{ProjectDirectory}/CMakeLists.txt" }, { "key": "CFileName", "value": "%{JS: 'main.' + Util.preferredSuffix('text/x-csrc')}" } ], @@ -29,7 +29,7 @@ "trDisplayName": "Define Build System", "trShortTitle": "Build System", "typeId": "Fields", - "enabled": "%{JS: ! %{IsSubproject}}", + "enabled": "%{JS: !value('IsSubproject')}", "data": [ { @@ -44,17 +44,17 @@ { "trKey": "qmake", "value": "qmake", - "condition": "%{JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0}" + "condition": "%{JS: value('Plugins').indexOf('QmakeProjectManager') >= 0}" }, { "trKey": "CMake", "value": "cmake", - "condition": "%{JS: [ %{Plugins} ].indexOf('CMakeProjectManager') >= 0}" + "condition": "%{JS: value('Plugins').indexOf('CMakeProjectManager') >= 0}" }, { "trKey": "Qbs", "value": "qbs", - "condition": "%{JS: [ %{Plugins} ].indexOf('QbsProjectManager') >= 0}" + "condition": "%{JS: value('Plugins').indexOf('QbsProjectManager') >= 0}" } ] } @@ -65,7 +65,7 @@ "trDisplayName": "Kit Selection", "trShortTitle": "Kits", "typeId": "Kits", - "enabled": "%{JS: ! %{IsSubproject}}", + "enabled": "%{JS: !value('IsSubproject')}", "data": { "projectFilePath": "%{ProjectFile}" } }, { @@ -84,18 +84,18 @@ "source": "file.pro", "target": "%{ProFile}", "openAsProject": true, - "condition": "%{JS: '%{BuildSystem}' === 'qmake'}" + "condition": "%{JS: value('BuildSystem') === 'qmake'}" }, { "source": "CMakeLists.txt", "openAsProject": true, - "condition": "%{JS: '%{BuildSystem}' === 'cmake'}" + "condition": "%{JS: value('BuildSystem') === 'cmake'}" }, { "source": "file.qbs", "target": "%{QbsFile}", "openAsProject": true, - "condition": "%{JS: '%{BuildSystem}' === 'qbs'}" + "condition": "%{JS: value('BuildSystem') === 'qbs'}" }, { "source": "main.c", @@ -105,7 +105,7 @@ { "source": "../git.ignore", "target": ".gitignore", - "condition": "%{JS: ! %{IsSubproject} && '%{VersionControl}' === 'G.Git'}" + "condition": "%{JS: !value('IsSubproject') && value('VersionControl') === 'G.Git'}" } ] } diff --git a/share/qtcreator/templates/wizards/projects/qmake/empty/wizard.json b/share/qtcreator/templates/wizards/projects/qmake/empty/wizard.json index d605b1c93d..19e10a8417 100644 --- a/share/qtcreator/templates/wizards/projects/qmake/empty/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qmake/empty/wizard.json @@ -8,11 +8,11 @@ "trDisplayCategory": "Other Project", "icon": "../../../global/guiapplication.png", "featuresRequired": [ "QtSupport.Wizards.FeatureQt" ], - "enabled": "%{JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('QmakeProjectManager') >= 0}", "options": [ - { "key": "ProFileName", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'pro')}" }, - { "key": "IsTopLevelProject", "value": "%{JS: !'%{Exists:ProjectExplorer.Profile.Ids}'}" } + { "key": "ProFileName", "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'pro')}" }, + { "key": "IsTopLevelProject", "value": "%{JS: !value('Exists:ProjectExplorer.Profile.Ids')}" } ], "pages": @@ -50,7 +50,7 @@ { "source": "../../git.ignore", "target": "%{ProjectDirectory}/.gitignore", - "condition": "%{JS: %{IsTopLevelProject} && '%{VersionControl}' === 'G.Git'}" + "condition": "%{JS: value('IsTopLevelProject') && value('VersionControl') === 'G.Git'}" } ] } diff --git a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/empty/wizard.json b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/empty/wizard.json index a6db89cd55..6d734cb0e8 100644 --- a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/empty/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/empty/wizard.json @@ -7,7 +7,7 @@ "trDisplayName": "Qt for Python - Empty", "trDisplayCategory": "Application", "icon": "icon.png", - "enabled": "%{JS: [ %{Plugins} ].indexOf('PythonEditor') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('PythonEditor') >= 0}", "featuresRequired": [ "QtSupport.Wizards.FeatureQt.5.6" ], "options": diff --git a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/mainwindow/wizard.json b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/mainwindow/wizard.json index 0fad3e3fe8..c8e397d0d8 100644 --- a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/mainwindow/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/mainwindow/wizard.json @@ -7,7 +7,7 @@ "trDisplayName": "Qt for Python - Window", "trDisplayCategory": "Application", "icon": "icon.png", - "enabled": "%{JS: [ %{Plugins} ].indexOf('PythonEditor') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('PythonEditor') >= 0}", "featuresRequired": [ "QtSupport.Wizards.FeatureQt.5.6" ], "options": @@ -52,14 +52,14 @@ "type": "LineEdit", "trDisplayName": "Source file:", "mandatory": true, - "data": { "trText": "%{JS: Cpp.classToFileName('%{Class}', '%{JS: Util.preferredSuffix('text/x-python')}')}" } + "data": { "trText": "%{JS: Cpp.classToFileName(value('Class'), Util.preferredSuffix('text/x-python'))}" } }, { "name": "ProjectFileName", "type": "LineEdit", "trDisplayName": "Project file:", "mandatory": true, - "data": { "trText": "%{JS: Cpp.classToFileName('%{Class}', 'pyproject')}" } + "data": { "trText": "%{JS: Cpp.classToFileName(value('Class'), 'pyproject')}" } } ] }, diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/empty/wizard.json b/share/qtcreator/templates/wizards/projects/qtquickapplication/empty/wizard.json index d26bec5ec6..91b7e3b860 100644 --- a/share/qtcreator/templates/wizards/projects/qtquickapplication/empty/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/empty/wizard.json @@ -8,20 +8,20 @@ "trDisplayCategory": "Application", "icon": "icon.png", "featuresRequired": [ "QtSupport.Wizards.FeatureQt.5.6" ], - "enabled": "%{JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0 || [ %{Plugins} ].indexOf('QbsProjectManager') >= 0 || [ %{Plugins} ].indexOf('CMakeProjectManager') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('QmakeProjectManager') >= 0 || value('Plugins').indexOf('QbsProjectManager') >= 0 || value('Plugins').indexOf('CMakeProjectManager') >= 0}", "options": [ - { "key": "ProjectFile", "value": "%{JS: '%{BuildSystem}' === 'qmake' ? '%{ProFile}' : ('%{BuildSystem}' === 'cmake' ? '%{CMakeFile}' : '%{QbsFile}')}" }, - { "key": "ProFile", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'pro')}" }, - { "key": "QbsFile", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'qbs')}" }, + { "key": "ProjectFile", "value": "%{JS: value('BuildSystem') === 'qmake' ? value('ProFile') : (value('BuildSystem') === 'cmake' ? value('CMakeFile') : value('QbsFile'))}" }, + { "key": "ProFile", "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'pro')}" }, + { "key": "QbsFile", "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'qbs')}" }, { "key": "CMakeFile", "value": "%{ProjectDirectory}/CMakeLists.txt" }, { "key": "MainCppFileName", "value": "%{JS: 'main.' + Util.preferredSuffix('text/x-c++src')}" }, - { "key": "QtQuickVersion", "value": "%{JS: %{QtVersion}.QtQuickVersion}" }, - { "key": "QtQuickWindowVersion", "value": "%{JS: %{QtVersion}.QtQuickWindowVersion}" }, - { "key": "QtQuickVirtualKeyboardImport", "value": "%{JS: %{QtVersion}.QtQuickVirtualKeyboardImport}" }, + { "key": "QtQuickVersion", "value": "%{JS: value('QtVersion').QtQuickVersion}" }, + { "key": "QtQuickWindowVersion", "value": "%{JS: value('QtVersion').QtQuickWindowVersion}" }, + { "key": "QtQuickVirtualKeyboardImport", "value": "%{JS: value('QtVersion').QtQuickVirtualKeyboardImport}" }, { "key": "QtQuickFeature", "value": "QtSupport.Wizards.FeatureQtQuick.%{QtQuickVersion}" }, - { "key": "UseVirtualKeyboardByDefault", "value": "%{JS: [ %{Plugins} ].indexOf('Boot2Qt') >= 0 || [ %{Plugins} ].indexOf('Boot2QtQdb') >= 0}" }, + { "key": "UseVirtualKeyboardByDefault", "value": "%{JS: value('Plugins').indexOf('Boot2Qt') >= 0 || value('Plugins').indexOf('Boot2QtQdb') >= 0}" }, { "key": "SetQPAPhysicalSize", "value": "%{UseVirtualKeyboardByDefault}" } ], @@ -36,7 +36,7 @@ "trDisplayName": "Define Build System", "trShortTitle": "Build System", "typeId": "Fields", - "enabled": "%{JS: ! %{IsSubproject}}", + "enabled": "%{JS: !value('IsSubproject')}", "data": [ { @@ -51,17 +51,17 @@ { "trKey": "qmake", "value": "qmake", - "condition": "%{JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0}" + "condition": "%{JS: value('Plugins').indexOf('QmakeProjectManager') >= 0}" }, { "trKey": "CMake", "value": "cmake", - "condition": "%{JS: [ %{Plugins} ].indexOf('CMakeProjectManager') >= 0}" + "condition": "%{JS: value('Plugins').indexOf('CMakeProjectManager') >= 0}" }, { "trKey": "Qbs", "value": "qbs", - "condition": "%{JS: [ %{Plugins} ].indexOf('QbsProjectManager') >= 0}" + "condition": "%{JS: value('Plugins').indexOf('QbsProjectManager') >= 0}" } ] } @@ -86,74 +86,74 @@ { "trKey": "Qt 5.13", "value": - "({ - 'QtQuickVersion': '2.13', - 'QtQuickWindowVersion': '2.13', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.4' - })" + { + "QtQuickVersion": "2.13", + "QtQuickWindowVersion": "2.13", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.4" + } }, { "trKey": "Qt 5.12", "value": - "({ - 'QtQuickVersion': '2.12', - 'QtQuickWindowVersion': '2.12', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.4' - })" + { + "QtQuickVersion": "2.12", + "QtQuickWindowVersion": "2.12", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.4" + } }, { "trKey": "Qt 5.11", "value": - "({ - 'QtQuickVersion': '2.11', - 'QtQuickWindowVersion': '2.11', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.3' - })" + { + "QtQuickVersion": "2.11", + "QtQuickWindowVersion": "2.11", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.3" + } }, { "trKey": "Qt 5.10", "value": - "({ - 'QtQuickVersion': '2.10', - 'QtQuickWindowVersion': '2.10', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.3' - })" + { + "QtQuickVersion": "2.10", + "QtQuickWindowVersion": "2.10", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.3" + } }, { "trKey": "Qt 5.9", "value": - "({ - 'QtQuickVersion': '2.9', - 'QtQuickWindowVersion': '2.2', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.2' - })" + { + "QtQuickVersion": "2.9", + "QtQuickWindowVersion": "2.9", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.2" + } }, { "trKey": "Qt 5.8", "value": - "({ - 'QtQuickVersion': '2.8', - 'QtQuickWindowVersion': '2.2', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.1' - })" + { + "QtQuickVersion": "2.8", + "QtQuickWindowVersion": "2.8", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.1" + } }, { "trKey": "Qt 5.7", "value": - "({ - 'QtQuickVersion': '2.7', - 'QtQuickWindowVersion': '2.2', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.1' - })" + { + "QtQuickVersion": "2.7", + "QtQuickWindowVersion": "2.7", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.1" + } }, { "trKey": "Qt 5.6", "value": - "({ - 'QtQuickVersion': '2.6', - 'QtQuickWindowVersion': '2.2', - 'QtQuickVirtualKeyboardImport': 'QtQuick.Enterprise.VirtualKeyboard 2.0' - })" + { + "QtQuickVersion": "2.6", + "QtQuickWindowVersion": "2.6", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.0" + } } ] } @@ -173,7 +173,7 @@ "trDisplayName": "Kit Selection", "trShortTitle": "Kits", "typeId": "Kits", - "enabled": "%{JS: ! %{IsSubproject}}", + "enabled": "%{JS: !value('IsSubproject')}", "data": { "projectFilePath": "%{ProjectFile}", "requiredFeatures": [ "QtSupport.Wizards.FeatureQt", "%{QtQuickFeature}" ] @@ -195,19 +195,19 @@ "source": "../app.pro", "target": "%{ProFile}", "openAsProject": true, - "condition": "%{JS: '%{BuildSystem}' === 'qmake'}" + "condition": "%{JS: value('BuildSystem') === 'qmake'}" }, { "source": "../CMakeLists.txt", "target": "CMakeLists.txt", "openAsProject": true, - "condition": "%{JS: '%{BuildSystem}' === 'cmake'}" + "condition": "%{JS: value('BuildSystem') === 'cmake'}" }, { "source": "../app.qbs", "target": "%{QbsFile}", "openAsProject": true, - "condition": "%{JS: '%{BuildSystem}' === 'qbs'}" + "condition": "%{JS: value('BuildSystem') === 'qbs'}" }, { "source": "../main.cpp", @@ -224,7 +224,7 @@ { "source": "../../git.ignore", "target": ".gitignore", - "condition": "%{JS: !%{IsSubproject} && '%{VersionControl}' === 'G.Git'}" + "condition": "%{JS: !value('IsSubproject') && value('VersionControl') === 'G.Git'}" } ] } diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/scroll/wizard.json b/share/qtcreator/templates/wizards/projects/qtquickapplication/scroll/wizard.json index 098456a431..301e915b86 100644 --- a/share/qtcreator/templates/wizards/projects/qtquickapplication/scroll/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/scroll/wizard.json @@ -8,22 +8,22 @@ "trDisplayCategory": "Application", "icon": "icon.png", "featuresRequired": [ "QtSupport.Wizards.FeatureQt.5.9" ], - "enabled": "%{JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0 || [ %{Plugins} ].indexOf('QbsProjectManager') >= 0 || [ %{Plugins} ].indexOf('CMakeProjectManager') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('QmakeProjectManager') >= 0 || value('Plugins').indexOf('QbsProjectManager') >= 0 || value('Plugins').indexOf('CMakeProjectManager') >= 0}", "options": [ - { "key": "ProjectFile", "value": "%{JS: '%{BuildSystem}' === 'qmake' ? '%{ProFile}' : ('%{BuildSystem}' === 'cmake' ? '%{CMakeFile}' : '%{QbsFile}')}" }, - { "key": "ProFile", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'pro')}" }, - { "key": "QbsFile", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'qbs')}" }, + { "key": "ProjectFile", "value": "%{JS: value('BuildSystem') === 'qmake' ? value('ProFile') : (value('BuildSystem') === 'cmake' ? value('CMakeFile') : value('QbsFile'))}" }, + { "key": "ProFile", "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'pro')}" }, + { "key": "QbsFile", "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'qbs')}" }, { "key": "CMakeFile", "value": "%{ProjectDirectory}/CMakeLists.txt" }, { "key": "MainCppFileName", "value": "%{JS: 'main.' + Util.preferredSuffix('text/x-c++src')}" }, - { "key": "QtQuickVersion", "value": "%{JS: %{QtVersion}.QtQuickVersion}" }, - { "key": "QtQuickControlsVersion", "value": "%{JS: %{QtVersion}.QtQuickControlsVersion}" }, - { "key": "QtQuickVirtualKeyboardImport", "value": "%{JS: %{QtVersion}.QtQuickVirtualKeyboardImport}" }, - { "key": "QtQuickControlsStyle", "value": "%{JS: %{ControlsStyle}.QtQuickControlsStyle}" }, - { "key": "QtQuickControlsStyleTheme", "value": "%{JS: %{ControlsStyle}.QtQuickControlsStyleTheme}" }, + { "key": "QtQuickVersion", "value": "%{JS: value('QtVersion').QtQuickVersion}" }, + { "key": "QtQuickControlsVersion", "value": "%{JS: value('QtVersion').QtQuickControlsVersion}" }, + { "key": "QtQuickVirtualKeyboardImport", "value": "%{JS: value('QtVersion').QtQuickVirtualKeyboardImport}" }, + { "key": "QtQuickControlsStyle", "value": "%{JS: value('ControlsStyle').QtQuickControlsStyle}" }, + { "key": "QtQuickControlsStyleTheme", "value": "%{JS: value('ControlsStyle').QtQuickControlsStyleTheme}" }, { "key": "QtQuickFeature", "value": "QtSupport.Wizards.FeatureQtQuick.%{QtQuickVersion}" }, - { "key": "UseVirtualKeyboardByDefault", "value": "%{JS: [ %{Plugins} ].indexOf('Boot2Qt') >= 0 || [ %{Plugins} ].indexOf('Boot2QtQdb') >= 0}" }, + { "key": "UseVirtualKeyboardByDefault", "value": "%{JS: value('Plugins').indexOf('Boot2Qt') >= 0 || value('Plugins').indexOf('Boot2QtQdb') >= 0}" }, { "key": "SetQPAPhysicalSize", "value": "%{UseVirtualKeyboardByDefault}" } ], @@ -38,7 +38,7 @@ "trDisplayName": "Define Build System", "trShortTitle": "Build System", "typeId": "Fields", - "enabled": "%{JS: ! %{IsSubproject}}", + "enabled": "%{JS: !value('IsSubproject')}", "data": [ { @@ -53,17 +53,17 @@ { "trKey": "qmake", "value": "qmake", - "condition": "%{JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0}" + "condition": "%{JS: value('Plugins').indexOf('QmakeProjectManager') >= 0}" }, { "trKey": "CMake", "value": "cmake", - "condition": "%{JS: [ %{Plugins} ].indexOf('CMakeProjectManager') >= 0}" + "condition": "%{JS: value('Plugins').indexOf('CMakeProjectManager') >= 0}" }, { "trKey": "Qbs", "value": "qbs", - "condition": "%{JS: [ %{Plugins} ].indexOf('QbsProjectManager') >= 0}" + "condition": "%{JS: value('Plugins').indexOf('QbsProjectManager') >= 0}" } ] } @@ -88,47 +88,47 @@ { "trKey": "Qt 5.13", "value": - "({ - 'QtQuickVersion': '2.13', - 'QtQuickControlsVersion': '2.13', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.4' - })" + { + "QtQuickVersion": "2.13", + "QtQuickControlsVersion": "2.13", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.4" + } }, { "trKey": "Qt 5.12", "value": - "({ - 'QtQuickVersion': '2.12', - 'QtQuickControlsVersion': '2.5', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.4' - })" + { + "QtQuickVersion": "2.12", + "QtQuickControlsVersion": "2.5", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.4" + } }, { "trKey": "Qt 5.11", "value": - "({ - 'QtQuickVersion': '2.11', - 'QtQuickControlsVersion': '2.4', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.3' - })" + { + "QtQuickVersion": "2.11", + "QtQuickControlsVersion": "2.4", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.3" + } }, { "trKey": "Qt 5.10", "value": - "({ - 'QtQuickVersion': '2.10', - 'QtQuickControlsVersion': '2.3', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.3' - })" + { + "QtQuickVersion": "2.10", + "QtQuickControlsVersion": "2.3", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.3" + } }, { "trKey": "Qt 5.9", "value": - "({ - 'QtQuickVersion': '2.9', - 'QtQuickControlsVersion': '2.2', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.2' - })" + { + "QtQuickVersion": "2.9", + "QtQuickControlsVersion": "2.2", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.2" + } } ] } @@ -145,66 +145,66 @@ { "trKey": "Default", "value": - "({ - 'QtQuickControlsStyle': 'Default', - 'QtQuickControlsStyleTheme': '' - })" + { + "QtQuickControlsStyle": "Default", + "QtQuickControlsStyleTheme": "" + } }, { "trKey": "Material Light", "value": - "({ - 'QtQuickControlsStyle': 'Material', - 'QtQuickControlsStyleTheme': 'Light' - })" + { + "QtQuickControlsStyle": "Material", + "QtQuickControlsStyleTheme": "Light" + } }, { "trKey": "Material Dark", "value": - "({ - 'QtQuickControlsStyle': 'Material', - 'QtQuickControlsStyleTheme': 'Dark' - })" + { + "QtQuickControlsStyle": "Material", + "QtQuickControlsStyleTheme": "Dark" + } }, { "trKey": "Universal Light", "value": - "({ - 'QtQuickControlsStyle': 'Universal', - 'QtQuickControlsStyleTheme': 'Light' - })" + { + "QtQuickControlsStyle": "Universal", + "QtQuickControlsStyleTheme": "Light" + } }, { "trKey": "Universal Dark", "value": - "({ - 'QtQuickControlsStyle': 'Universal', - 'QtQuickControlsStyleTheme': 'Dark' - })" + { + "QtQuickControlsStyle": "Universal", + "QtQuickControlsStyleTheme": "Dark" + } }, { "trKey": "Universal System", "value": - "({ - 'QtQuickControlsStyle': 'Universal', - 'QtQuickControlsStyleTheme': 'System' - })" + { + "QtQuickControlsStyle": "Universal", + "QtQuickControlsStyleTheme": "System" + } }, { "trKey": "Fusion (Qt 5.10+)", "value": - "({ - 'QtQuickControlsStyle': 'Fusion', - 'QtQuickControlsStyleTheme': '' - })" + { + "QtQuickControlsStyle": "Fusion", + "QtQuickControlsStyleTheme": "" + } }, { "trKey": "Imagine (Qt 5.10+)", "value": - "({ - 'QtQuickControlsStyle': 'Imagine', - 'QtQuickControlsStyleTheme': '' - })" + { + "QtQuickControlsStyle": "Imagine", + "QtQuickControlsStyleTheme": "" + } } ] } @@ -224,7 +224,7 @@ "trDisplayName": "Kit Selection", "trShortTitle": "Kits", "typeId": "Kits", - "enabled": "%{JS: ! %{IsSubproject}}", + "enabled": "%{JS: !value('IsSubproject')}", "data": { "projectFilePath": "%{ProjectFile}", "requiredFeatures": [ "QtSupport.Wizards.FeatureQt", "%{QtQuickFeature}" ] @@ -246,19 +246,19 @@ "source": "../app.pro", "target": "%{ProFile}", "openAsProject": true, - "condition": "%{JS: '%{BuildSystem}' === 'qmake'}" + "condition": "%{JS: value('BuildSystem') === 'qmake'}" }, { "source": "../CMakeLists.txt", "target": "CMakeLists.txt", "openAsProject": true, - "condition": "%{JS: '%{BuildSystem}' === 'cmake'}" + "condition": "%{JS: value('BuildSystem') === 'cmake'}" }, { "source": "../app.qbs", "target": "%{QbsFile}", "openAsProject": true, - "condition": "%{JS: '%{BuildSystem}' === 'qbs'}" + "condition": "%{JS: value('BuildSystem') === 'qbs'}" }, { "source": "../main.cpp", @@ -279,7 +279,7 @@ { "source": "../../git.ignore", "target": ".gitignore", - "condition": "%{JS: !%{IsSubproject} && '%{VersionControl}' === 'G.Git'}" + "condition": "%{JS: !value('IsSubproject') && value('VersionControl') === 'G.Git'}" } ] } diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/stack/wizard.json b/share/qtcreator/templates/wizards/projects/qtquickapplication/stack/wizard.json index 0b0f8558ac..96b3a439b9 100644 --- a/share/qtcreator/templates/wizards/projects/qtquickapplication/stack/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/stack/wizard.json @@ -8,22 +8,22 @@ "trDisplayCategory": "Application", "icon": "icon.png", "featuresRequired": [ "QtSupport.Wizards.FeatureQt.5.7" ], - "enabled": "%{JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0 || [ %{Plugins} ].indexOf('QbsProjectManager') >= 0 || [ %{Plugins} ].indexOf('CMakeProjectManager') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('QmakeProjectManager') >= 0 || value('Plugins').indexOf('QbsProjectManager') >= 0 || value('Plugins').indexOf('CMakeProjectManager') >= 0}", "options": [ - { "key": "ProjectFile", "value": "%{JS: '%{BuildSystem}' === 'qmake' ? '%{ProFile}' : ('%{BuildSystem}' === 'cmake' ? '%{CMakeFile}' : '%{QbsFile}')}" }, - { "key": "ProFile", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'pro')}" }, - { "key": "QbsFile", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'qbs')}" }, + { "key": "ProjectFile", "value": "%{JS: value('BuildSystem') === 'qmake' ? value('ProFile') : (value('BuildSystem') === 'cmake' ? value('CMakeFile') : value('QbsFile'))}" }, + { "key": "ProFile", "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'pro')}" }, + { "key": "QbsFile", "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'qbs')}" }, { "key": "CMakeFile", "value": "%{ProjectDirectory}/CMakeLists.txt" }, { "key": "MainCppFileName", "value": "%{JS: 'main.' + Util.preferredSuffix('text/x-c++src')}" }, - { "key": "QtQuickVersion", "value": "%{JS: %{QtVersion}.QtQuickVersion}" }, - { "key": "QtQuickControlsVersion", "value": "%{JS: %{QtVersion}.QtQuickControlsVersion}" }, - { "key": "QtQuickVirtualKeyboardImport", "value": "%{JS: %{QtVersion}.QtQuickVirtualKeyboardImport}" }, - { "key": "QtQuickControlsStyle", "value": "%{JS: %{ControlsStyle}.QtQuickControlsStyle}" }, - { "key": "QtQuickControlsStyleTheme", "value": "%{JS: %{ControlsStyle}.QtQuickControlsStyleTheme}" }, + { "key": "QtQuickVersion", "value": "%{JS: value('QtVersion').QtQuickVersion}" }, + { "key": "QtQuickControlsVersion", "value": "%{JS: value('QtVersion').QtQuickControlsVersion}" }, + { "key": "QtQuickVirtualKeyboardImport", "value": "%{JS: value('QtVersion').QtQuickVirtualKeyboardImport}" }, + { "key": "QtQuickControlsStyle", "value": "%{JS: value('ControlsStyle').QtQuickControlsStyle}" }, + { "key": "QtQuickControlsStyleTheme", "value": "%{JS: value('ControlsStyle').QtQuickControlsStyleTheme}" }, { "key": "QtQuickFeature", "value": "QtSupport.Wizards.FeatureQtQuick.%{QtQuickVersion}" }, - { "key": "UseVirtualKeyboardByDefault", "value": "%{JS: [ %{Plugins} ].indexOf('Boot2Qt') >= 0 || [ %{Plugins} ].indexOf('Boot2QtQdb') >= 0}" }, + { "key": "UseVirtualKeyboardByDefault", "value": "%{JS: value('Plugins').indexOf('Boot2Qt') >= 0 || value('Plugins').indexOf('Boot2QtQdb') >= 0}" }, { "key": "SetQPAPhysicalSize", "value": "%{UseVirtualKeyboardByDefault}" } ], @@ -38,7 +38,7 @@ "trDisplayName": "Define Build System", "trShortTitle": "Build System", "typeId": "Fields", - "enabled": "%{JS: ! %{IsSubproject}}", + "enabled": "%{JS: !value('IsSubproject')}", "data": [ { @@ -53,17 +53,17 @@ { "trKey": "qmake", "value": "qmake", - "condition": "%{JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0}" + "condition": "%{JS: value('Plugins').indexOf('QmakeProjectManager') >= 0}" }, { "trKey": "CMake", "value": "cmake", - "condition": "%{JS: [ %{Plugins} ].indexOf('CMakeProjectManager') >= 0}" + "condition": "%{JS: value('Plugins').indexOf('CMakeProjectManager') >= 0}" }, { "trKey": "Qbs", "value": "qbs", - "condition": "%{JS: [ %{Plugins} ].indexOf('QbsProjectManager') >= 0}" + "condition": "%{JS: value('Plugins').indexOf('QbsProjectManager') >= 0}" } ] } @@ -88,65 +88,65 @@ { "trKey": "Qt 5.13", "value": - "({ - 'QtQuickVersion': '2.13', - 'QtQuickControlsVersion': '2.13', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.4' - })" + { + "QtQuickVersion": "2.13", + "QtQuickControlsVersion": "2.13", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.4" + } }, { "trKey": "Qt 5.12", "value": - "({ - 'QtQuickVersion': '2.12', - 'QtQuickControlsVersion': '2.5', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.4' - })" + { + "QtQuickVersion": "2.12", + "QtQuickControlsVersion": "2.5", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.4" + } }, { "trKey": "Qt 5.11", "value": - "({ - 'QtQuickVersion': '2.11', - 'QtQuickControlsVersion': '2.4', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.3' - })" + { + "QtQuickVersion": "2.11", + "QtQuickControlsVersion": "2.4", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.3" + } }, { "trKey": "Qt 5.10", "value": - "({ - 'QtQuickVersion': '2.10', - 'QtQuickControlsVersion': '2.3', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.3' - })" + { + "QtQuickVersion": "2.10", + "QtQuickControlsVersion": "2.3", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.3" + } }, { "trKey": "Qt 5.9", "value": - "({ - 'QtQuickVersion': '2.9', - 'QtQuickControlsVersion': '2.2', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.2' - })" + { + "QtQuickVersion": "2.9", + "QtQuickControlsVersion": "2.2", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.2" + } }, { "trKey": "Qt 5.8", "value": - "({ - 'QtQuickVersion': '2.8', - 'QtQuickControlsVersion': '2.1', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.1' - })" + { + "QtQuickVersion": "2.8", + "QtQuickControlsVersion": "2.1", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.1" + } }, { "trKey": "Qt 5.7", "value": - "({ - 'QtQuickVersion': '2.7', - 'QtQuickControlsVersion': '2.0', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.1' - })" + { + "QtQuickVersion": "2.7", + "QtQuickControlsVersion": "2.0", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.1" + } } ] } @@ -163,66 +163,66 @@ { "trKey": "Default", "value": - "({ - 'QtQuickControlsStyle': 'Default', - 'QtQuickControlsStyleTheme': '' - })" + { + "QtQuickControlsStyle": "Default", + "QtQuickControlsStyleTheme": "" + } }, { "trKey": "Material Light", "value": - "({ - 'QtQuickControlsStyle': 'Material', - 'QtQuickControlsStyleTheme': 'Light' - })" + { + "QtQuickControlsStyle": "Material", + "QtQuickControlsStyleTheme": "Light" + } }, { "trKey": "Material Dark", "value": - "({ - 'QtQuickControlsStyle': 'Material', - 'QtQuickControlsStyleTheme': 'Dark' - })" + { + "QtQuickControlsStyle": "Material", + "QtQuickControlsStyleTheme": "Dark" + } }, { "trKey": "Universal Light", "value": - "({ - 'QtQuickControlsStyle': 'Universal', - 'QtQuickControlsStyleTheme': 'Light' - })" + { + "QtQuickControlsStyle": "Universal", + "QtQuickControlsStyleTheme": "Light" + } }, { "trKey": "Universal Dark", "value": - "({ - 'QtQuickControlsStyle': 'Universal', - 'QtQuickControlsStyleTheme': 'Dark' - })" + { + "QtQuickControlsStyle": "Universal", + "QtQuickControlsStyleTheme": "Dark" + } }, { "trKey": "Universal System", "value": - "({ - 'QtQuickControlsStyle': 'Universal', - 'QtQuickControlsStyleTheme': 'System' - })" + { + "QtQuickControlsStyle": "Universal", + "QtQuickControlsStyleTheme": "System" + } }, { "trKey": "Fusion (Qt 5.10+)", "value": - "({ - 'QtQuickControlsStyle': 'Fusion', - 'QtQuickControlsStyleTheme': '' - })" + { + "QtQuickControlsStyle": "Fusion", + "QtQuickControlsStyleTheme": "" + } }, { "trKey": "Imagine (Qt 5.10+)", "value": - "({ - 'QtQuickControlsStyle': 'Imagine', - 'QtQuickControlsStyleTheme': '' - })" + { + "QtQuickControlsStyle": "Imagine", + "QtQuickControlsStyleTheme": "" + } } ] } @@ -242,7 +242,7 @@ "trDisplayName": "Kit Selection", "trShortTitle": "Kits", "typeId": "Kits", - "enabled": "%{JS: ! %{IsSubproject}}", + "enabled": "%{JS: !value('IsSubproject')}", "data": { "projectFilePath": "%{ProjectFile}", "requiredFeatures": [ "QtSupport.Wizards.FeatureQt", "%{QtQuickFeature}" ] @@ -264,19 +264,19 @@ "source": "../app.pro", "target": "%{ProFile}", "openAsProject": true, - "condition": "%{JS: '%{BuildSystem}' === 'qmake'}" + "condition": "%{JS: value('BuildSystem') === 'qmake'}" }, { "source": "../CMakeLists.txt", "target": "CMakeLists.txt", "openAsProject": true, - "condition": "%{JS: '%{BuildSystem}' === 'cmake'}" + "condition": "%{JS: value('BuildSystem') === 'cmake'}" }, { "source": "../app.qbs", "target": "%{QbsFile}", "openAsProject": true, - "condition": "%{JS: '%{BuildSystem}' === 'qbs'}" + "condition": "%{JS: value('BuildSystem') === 'qbs'}" }, { "source": "../main.cpp", @@ -309,7 +309,7 @@ { "source": "../../git.ignore", "target": ".gitignore", - "condition": "%{JS: !%{IsSubproject} && '%{VersionControl}' === 'G.Git'}" + "condition": "%{JS: !value('IsSubproject') && value('VersionControl') === 'G.Git'}" } ] } diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/swipe/wizard.json b/share/qtcreator/templates/wizards/projects/qtquickapplication/swipe/wizard.json index a89e6cce26..5f15dbffbe 100644 --- a/share/qtcreator/templates/wizards/projects/qtquickapplication/swipe/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/swipe/wizard.json @@ -8,22 +8,22 @@ "trDisplayCategory": "Application", "icon": "icon.png", "featuresRequired": [ "QtSupport.Wizards.FeatureQt.5.7" ], - "enabled": "%{JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0 || [ %{Plugins} ].indexOf('QbsProjectManager') >= 0 || [ %{Plugins} ].indexOf('CMakeProjectManager') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('QmakeProjectManager') >= 0 || value('Plugins').indexOf('QbsProjectManager') >= 0 || value('Plugins').indexOf('CMakeProjectManager') >= 0}", "options": [ - { "key": "ProjectFile", "value": "%{JS: '%{BuildSystem}' === 'qmake' ? '%{ProFile}' : ('%{BuildSystem}' === 'cmake' ? '%{CMakeFile}' : '%{QbsFile}')}" }, - { "key": "ProFile", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'pro')}" }, - { "key": "QbsFile", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'qbs')}" }, + { "key": "ProjectFile", "value": "%{JS: value('BuildSystem') === 'qmake' ? value('ProFile') : (value('BuildSystem') === 'cmake' ? value('CMakeFile') : value('QbsFile'))}" }, + { "key": "ProFile", "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'pro')}" }, + { "key": "QbsFile", "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'qbs')}" }, { "key": "CMakeFile", "value": "%{ProjectDirectory}/CMakeLists.txt" }, { "key": "MainCppFileName", "value": "%{JS: 'main.' + Util.preferredSuffix('text/x-c++src')}" }, - { "key": "QtQuickVersion", "value": "%{JS: %{QtVersion}.QtQuickVersion}" }, - { "key": "QtQuickControlsVersion", "value": "%{JS: %{QtVersion}.QtQuickControlsVersion}" }, - { "key": "QtQuickVirtualKeyboardImport", "value": "%{JS: %{QtVersion}.QtQuickVirtualKeyboardImport}" }, - { "key": "QtQuickControlsStyle", "value": "%{JS: %{ControlsStyle}.QtQuickControlsStyle}" }, - { "key": "QtQuickControlsStyleTheme", "value": "%{JS: %{ControlsStyle}.QtQuickControlsStyleTheme}" }, + { "key": "QtQuickVersion", "value": "%{JS: value('QtVersion').QtQuickVersion}" }, + { "key": "QtQuickControlsVersion", "value": "%{JS: value('QtVersion').QtQuickControlsVersion}" }, + { "key": "QtQuickVirtualKeyboardImport", "value": "%{JS: value('QtVersion').QtQuickVirtualKeyboardImport}" }, + { "key": "QtQuickControlsStyle", "value": "%{JS: value('ControlsStyle').QtQuickControlsStyle}" }, + { "key": "QtQuickControlsStyleTheme", "value": "%{JS: value('ControlsStyle').QtQuickControlsStyleTheme}" }, { "key": "QtQuickFeature", "value": "QtSupport.Wizards.FeatureQtQuick.%{QtQuickVersion}" }, - { "key": "UseVirtualKeyboardByDefault", "value": "%{JS: [ %{Plugins} ].indexOf('Boot2Qt') >= 0 || [ %{Plugins} ].indexOf('Boot2QtQdb') >= 0}" }, + { "key": "UseVirtualKeyboardByDefault", "value": "%{JS: value('Plugins').indexOf('Boot2Qt') >= 0 || value('Plugins').indexOf('Boot2QtQdb') >= 0}" }, { "key": "SetQPAPhysicalSize", "value": "%{UseVirtualKeyboardByDefault}" } ], @@ -38,7 +38,7 @@ "trDisplayName": "Define Build System", "trShortTitle": "Build System", "typeId": "Fields", - "enabled": "%{JS: ! %{IsSubproject}}", + "enabled": "%{JS: !value('IsSubproject')}", "data": [ { @@ -53,17 +53,17 @@ { "trKey": "qmake", "value": "qmake", - "condition": "%{JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0}" + "condition": "%{JS: value('Plugins').indexOf('QmakeProjectManager') >= 0}" }, { "trKey": "CMake", "value": "cmake", - "condition": "%{JS: [ %{Plugins} ].indexOf('CMakeProjectManager') >= 0}" + "condition": "%{JS: value('Plugins').indexOf('CMakeProjectManager') >= 0}" }, { "trKey": "Qbs", "value": "qbs", - "condition": "%{JS: [ %{Plugins} ].indexOf('QbsProjectManager') >= 0}" + "condition": "%{JS: value('Plugins').indexOf('QbsProjectManager') >= 0}" } ] } @@ -88,65 +88,65 @@ { "trKey": "Qt 5.13", "value": - "({ - 'QtQuickVersion': '2.13', - 'QtQuickControlsVersion': '2.13', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.4' - })" + { + "QtQuickVersion": "2.13", + "QtQuickControlsVersion": "2.13", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.4" + } }, { "trKey": "Qt 5.12", "value": - "({ - 'QtQuickVersion': '2.12', - 'QtQuickControlsVersion': '2.5', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.4' - })" + { + "QtQuickVersion": "2.12", + "QtQuickControlsVersion": "2.5", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.4" + } }, { "trKey": "Qt 5.11", "value": - "({ - 'QtQuickVersion': '2.11', - 'QtQuickControlsVersion': '2.4', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.3' - })" + { + "QtQuickVersion": "2.11", + "QtQuickControlsVersion": "2.4", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.3" + } }, { "trKey": "Qt 5.10", "value": - "({ - 'QtQuickVersion': '2.10', - 'QtQuickControlsVersion': '2.3', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.3' - })" + { + "QtQuickVersion": "2.10", + "QtQuickControlsVersion": "2.3", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.3" + } }, { "trKey": "Qt 5.9", "value": - "({ - 'QtQuickVersion': '2.9', - 'QtQuickControlsVersion': '2.2', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.2' - })" + { + "QtQuickVersion": "2.9", + "QtQuickControlsVersion": "2.2", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.2" + } }, { "trKey": "Qt 5.8", "value": - "({ - 'QtQuickVersion': '2.8', - 'QtQuickControlsVersion': '2.1', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.1' - })" + { + "QtQuickVersion": "2.8", + "QtQuickControlsVersion": "2.1", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.1" + } }, { "trKey": "Qt 5.7", "value": - "({ - 'QtQuickVersion': '2.7', - 'QtQuickControlsVersion': '2.0', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.1' - })" + { + "QtQuickVersion": "2.7", + "QtQuickControlsVersion": "2.0", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.1" + } } ] } @@ -163,66 +163,66 @@ { "trKey": "Default", "value": - "({ - 'QtQuickControlsStyle': 'Default', - 'QtQuickControlsStyleTheme': '' - })" + { + "QtQuickControlsStyle": "Default", + "QtQuickControlsStyleTheme": "" + } }, { "trKey": "Material Light", "value": - "({ - 'QtQuickControlsStyle': 'Material', - 'QtQuickControlsStyleTheme': 'Light' - })" + { + "QtQuickControlsStyle": "Material", + "QtQuickControlsStyleTheme": "Light" + } }, { "trKey": "Material Dark", "value": - "({ - 'QtQuickControlsStyle': 'Material', - 'QtQuickControlsStyleTheme': 'Dark' - })" + { + "QtQuickControlsStyle": "Material", + "QtQuickControlsStyleTheme": "Dark" + } }, { "trKey": "Universal Light", "value": - "({ - 'QtQuickControlsStyle': 'Universal', - 'QtQuickControlsStyleTheme': 'Light' - })" + { + "QtQuickControlsStyle": "Universal", + "QtQuickControlsStyleTheme": "Light" + } }, { "trKey": "Universal Dark", "value": - "({ - 'QtQuickControlsStyle': 'Universal', - 'QtQuickControlsStyleTheme': 'Dark' - })" + { + "QtQuickControlsStyle": "Universal", + "QtQuickControlsStyleTheme": "Dark" + } }, { "trKey": "Universal System", "value": - "({ - 'QtQuickControlsStyle': 'Universal', - 'QtQuickControlsStyleTheme': 'System' - })" + { + "QtQuickControlsStyle": "Universal", + "QtQuickControlsStyleTheme": "System" + } }, { "trKey": "Fusion (Qt 5.10+)", "value": - "({ - 'QtQuickControlsStyle': 'Fusion', - 'QtQuickControlsStyleTheme': '' - })" + { + "QtQuickControlsStyle": "Fusion", + "QtQuickControlsStyleTheme": "" + } }, { "trKey": "Imagine (Qt 5.10+)", "value": - "({ - 'QtQuickControlsStyle': 'Imagine', - 'QtQuickControlsStyleTheme': '' - })" + { + "QtQuickControlsStyle": "Imagine", + "QtQuickControlsStyleTheme": "" + } } ] } @@ -242,7 +242,7 @@ "trDisplayName": "Kit Selection", "trShortTitle": "Kits", "typeId": "Kits", - "enabled": "%{JS: ! %{IsSubproject}}", + "enabled": "%{JS: !value('IsSubproject')}", "data": { "projectFilePath": "%{ProjectFile}", "requiredFeatures": [ "QtSupport.Wizards.FeatureQt", "%{QtQuickFeature}" ] @@ -264,19 +264,19 @@ "source": "../app.pro", "target": "%{ProFile}", "openAsProject": true, - "condition": "%{JS: '%{BuildSystem}' === 'qmake'}" + "condition": "%{JS: value('BuildSystem') === 'qmake'}" }, { "source": "../CMakeLists.txt", "target": "CMakeLists.txt", "openAsProject": true, - "condition": "%{JS: '%{BuildSystem}' === 'cmake'}" + "condition": "%{JS: value('BuildSystem') === 'cmake'}" }, { "source": "../app.qbs", "target": "%{QbsFile}", "openAsProject": true, - "condition": "%{JS: '%{BuildSystem}' === 'qbs'}" + "condition": "%{JS: value('BuildSystem') === 'qbs'}" }, { "source": "../main.cpp", @@ -305,7 +305,7 @@ { "source": "../../git.ignore", "target": ".gitignore", - "condition": "%{JS: !%{IsSubproject} && '%{VersionControl}' === 'G.Git'}" + "condition": "%{JS: !value('IsSubproject') && value('VersionControl') === 'G.Git'}" } ] } diff --git a/share/qtcreator/templates/wizards/projects/qtquickuiprototype/wizard.json b/share/qtcreator/templates/wizards/projects/qtquickuiprototype/wizard.json index 8a726cc09c..508e0b41ff 100644 --- a/share/qtcreator/templates/wizards/projects/qtquickuiprototype/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qtquickuiprototype/wizard.json @@ -7,18 +7,18 @@ "trDisplayName": "Qt Quick UI Prototype", "trDisplayCategory": "Other Project", "icon": "qtquickuiprototype.png", - "enabled": "%{JS: [ %{Plugins} ].indexOf('QmlProjectManager') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('QmlProjectManager') >= 0}", "featuresRequired": [ "QtSupport.Wizards.FeatureQtQuickProject", "QtSupport.Wizards.FeatureQt" ], "options": [ - { "key": "QmlProjectFileName", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'qmlproject')}" }, - { "key": "MainQmlFileName", "value": "%{JS: Util.fileName('%{ProjectName}', 'qml')}" }, - { "key": "QtQuickVersion", "value": "%{JS: %{QtVersion}.QtQuickVersion}" }, - { "key": "QtQuickWindowVersion", "value": "%{JS: %{QtVersion}.QtQuickWindowVersion}" }, - { "key": "QtQuickVirtualKeyboardImport", "value": "%{JS: %{QtVersion}.QtQuickVirtualKeyboardImport}" }, + { "key": "QmlProjectFileName", "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'qmlproject')}" }, + { "key": "MainQmlFileName", "value": "%{JS: Util.fileName(value('ProjectName'), 'qml')}" }, + { "key": "QtQuickVersion", "value": "%{JS: value('QtVersion').QtQuickVersion}" }, + { "key": "QtQuickWindowVersion", "value": "%{JS: value('QtVersion').QtQuickWindowVersion}" }, + { "key": "QtQuickVirtualKeyboardImport", "value": "%{JS: value('QtVersion').QtQuickVirtualKeyboardImport}" }, { "key": "QtQuickFeature", "value": "QtSupport.Wizards.FeatureQtQuick.%{QtQuickVersion}" }, - { "key": "UseVirtualKeyboardByDefault", "value": "%{JS: [ %{Plugins} ].indexOf('Boot2Qt') >= 0 || [ %{Plugins} ].indexOf('Boot2QtQdb') >= 0}" } + { "key": "UseVirtualKeyboardByDefault", "value": "%{JS: value('Plugins').indexOf('Boot2Qt') >= 0 || value('Plugins').indexOf('Boot2QtQdb') >= 0}" } ], "pages": @@ -46,74 +46,74 @@ { "trKey": "Qt 5.13", "value": - "({ - 'QtQuickVersion': '2.13', - 'QtQuickWindowVersion': '2.13', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.4' - })" + { + "QtQuickVersion": "2.13", + "QtQuickWindowVersion": "2.13", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.4" + } }, { "trKey": "Qt 5.12", "value": - "({ - 'QtQuickVersion': '2.12', - 'QtQuickWindowVersion': '2.12', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.4' - })" + { + "QtQuickVersion": "2.12", + "QtQuickWindowVersion": "2.12", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.4" + } }, { "trKey": "Qt 5.11", "value": - "({ - 'QtQuickVersion': '2.11', - 'QtQuickWindowVersion': '2.11', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.3' - })" + { + "QtQuickVersion": "2.11", + "QtQuickWindowVersion": "2.11", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.3" + } }, { "trKey": "Qt 5.10", "value": - "({ - 'QtQuickVersion': '2.10', - 'QtQuickWindowVersion': '2.10', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.3' - })" + { + "QtQuickVersion": "2.10", + "QtQuickWindowVersion": "2.10", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.3" + } }, { "trKey": "Qt 5.9", "value": - "({ - 'QtQuickVersion': '2.9', - 'QtQuickWindowVersion': '2.3', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.2' - })" + { + "QtQuickVersion": "2.9", + "QtQuickWindowVersion": "2.9", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.2" + } }, { "trKey": "Qt 5.8", "value": - "({ - 'QtQuickVersion': '2.8', - 'QtQuickWindowVersion': '2.2', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.1' - })" + { + "QtQuickVersion": "2.8", + "QtQuickWindowVersion": "2.8", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.1" + } }, { "trKey": "Qt 5.7", "value": - "({ - 'QtQuickVersion': '2.7', - 'QtQuickWindowVersion': '2.2', - 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.1' - })" + { + "QtQuickVersion": "2.7", + "QtQuickWindowVersion": "2.7", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.1" + } }, { "trKey": "Qt 5.6", "value": - "({ - 'QtQuickVersion': '2.6', - 'QtQuickWindowVersion': '2.2', - 'QtQuickVirtualKeyboardImport': 'QtQuick.Enterprise.VirtualKeyboard 2.0' - })" + { + "QtQuickVersion": "2.6", + "QtQuickWindowVersion": "2.6", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.0" + } } ] } @@ -164,7 +164,7 @@ { "source": "../git.ignore", "target": "%{ProjectDirectory}/.gitignore", - "condition": "%{JS: !%{IsSubproject} && '%{VersionControl}' === 'G.Git'}" + "condition": "%{JS: !value('IsSubproject') && value('VersionControl') === 'G.Git'}" } ] } diff --git a/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/wizard.json b/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/wizard.json index bff52de6a3..fa7a4124ef 100644 --- a/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/wizard.json @@ -8,18 +8,18 @@ "trDisplayCategory": "Application", "icon": "../../global/guiapplication.png", "featuresRequired": [ "QtSupport.Wizards.FeatureQt" ], - "enabled": "%{JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0 || [ %{Plugins} ].indexOf('CMakeProjectManager') >= 0 || [ %{Plugins} ].indexOf('QbsProjectManager') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('QmakeProjectManager') >= 0 || value('Plugins').indexOf('CMakeProjectManager') >= 0 || value('Plugins').indexOf('QbsProjectManager') >= 0}", "options": [ - { "key": "ProjectFile", "value": "%{JS: '%{BuildSystem}' === 'qmake' ? '%{ProFile}' : '%{BuildSystem}' === 'cmake' ? '%{CMakeFile}' : '%{QbsFile}'}" }, - { "key": "ProFile", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'pro')}" }, + { "key": "ProjectFile", "value": "%{JS: value('BuildSystem') === 'qmake' ? value('ProFile') : value('BuildSystem') === 'cmake' ? value('CMakeFile') : value('QbsFile')}" }, + { "key": "ProFile", "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'pro')}" }, { "key": "CMakeFile", "value": "%{ProjectDirectory}/CMakeLists.txt" }, - { "key": "QbsFile", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'qbs')}" }, + { "key": "QbsFile", "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('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}')}" }, - { "key": "GUARD", "value": "%{JS: Cpp.headerGuard('%{HdrFileName}')}" } + { "key": "UiHdrFileName", "value": "%{JS: (value('BuildSystem') === 'cmake' ? (Util.path(value('FormFileName')) + '/') : '') + 'ui_' + Util.completeBaseName(value('FormFileName')) + '.h'}" }, + { "key": "CN", "value": "%{JS: Cpp.className(value('Class'))}" }, + { "key": "GUARD", "value": "%{JS: Cpp.headerGuard(value('HdrFileName'))}" } ], "pages": @@ -34,7 +34,7 @@ "trDisplayName": "Define Build System", "trShortTitle": "Build System", "typeId": "Fields", - "enabled": "%{JS: ! %{IsSubproject}}", + "enabled": "%{JS: !value('IsSubproject')}", "data": [ { @@ -47,19 +47,19 @@ "items": [ { - "trKey": "QMake", + "trKey": "qmake", "value": "qmake", - "condition": "%{JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0}" + "condition": "%{JS: value('Plugins').indexOf('QmakeProjectManager') >= 0}" }, { "trKey": "CMake", "value": "cmake", - "condition": "%{JS: [ %{Plugins} ].indexOf('CMakeProjectManager') >= 0}" + "condition": "%{JS: value('Plugins').indexOf('CMakeProjectManager') >= 0}" }, { "trKey": "Qbs", "value": "qbs", - "condition": "%{JS: [ %{Plugins} ].indexOf('QbsProjectManager') >= 0}" + "condition": "%{JS: value('Plugins').indexOf('QbsProjectManager') >= 0}" } ] } @@ -93,7 +93,7 @@ "data": { "validator": "(?:(?:[a-zA-Z_][a-zA-Z_0-9]*::)*[a-zA-Z_][a-zA-Z_0-9]*|)", - "trText": "%{JS: '%{BaseClass}'.slice(1)}" + "trText": "%{JS: value('BaseClass') ? value('BaseClass').slice(1) : 'MyClass'}" } }, { @@ -114,14 +114,14 @@ "type": "LineEdit", "trDisplayName": "Header file:", "mandatory": true, - "data": { "trText": "%{JS: Cpp.classToFileName('%{Class}', '%{JS: Util.preferredSuffix('text/x-c++hdr')}')}" } + "data": { "trText": "%{JS: Cpp.classToFileName(value('Class'), Util.preferredSuffix('text/x-c++hdr'))}" } }, { "name": "SrcFileName", "type": "LineEdit", "trDisplayName": "Source file:", "mandatory": true, - "data": { "trText": "%{JS: Cpp.classToFileName('%{Class}', '%{JS: Util.preferredSuffix('text/x-c++src')}')}" } + "data": { "trText": "%{JS: Cpp.classToFileName(value('Class'), Util.preferredSuffix('text/x-c++src'))}" } }, { "name": "GenerateForm", @@ -135,7 +135,7 @@ "trDisplayName": "Form file:", "enabled": "%{GenerateForm}", "mandatory": true, - "data": { "trText": "%{JS: Cpp.classToFileName('%{Class}', 'ui')}" } + "data": { "trText": "%{JS: Cpp.classToFileName(value('Class'), 'ui')}" } } ] }, @@ -143,7 +143,7 @@ "trDisplayName": "Kit Selection", "trShortTitle": "Kits", "typeId": "Kits", - "enabled": "%{JS: ! %{IsSubproject}}", + "enabled": "%{JS: !value('IsSubproject')}", "data": { "projectFilePath": "%{ProjectFile}" } }, { @@ -162,18 +162,18 @@ "source": "project.pro", "target": "%{ProFile}", "openAsProject": true, - "condition": "%{JS: '%{BuildSystem}' === 'qmake'}" + "condition": "%{JS: value('BuildSystem') === 'qmake'}" }, { "source": "CMakeLists.txt", "openAsProject": true, - "condition": "%{JS: '%{BuildSystem}' === 'cmake'}" + "condition": "%{JS: value('BuildSystem') === 'cmake'}" }, { "source": "project.qbs", "target": "%{QbsFile}", "openAsProject": true, - "condition": "%{JS: '%{BuildSystem}' === 'qbs'}" + "condition": "%{JS: value('BuildSystem') === 'qbs'}" }, { "source": "main.cpp", @@ -196,7 +196,7 @@ { "source": "../git.ignore", "target": ".gitignore", - "condition": "%{JS: ! %{IsSubproject} && '%{VersionControl}' === 'G.Git'}" + "condition": "%{JS: !value('IsSubproject') && value('VersionControl') === 'G.Git'}" } ] } |