aboutsummaryrefslogtreecommitdiffstats
path: root/share/qtcreator/templates/wizards
diff options
context:
space:
mode:
Diffstat (limited to 'share/qtcreator/templates/wizards')
-rw-r--r--share/qtcreator/templates/wizards/autotest/files/tst.txt3
-rw-r--r--share/qtcreator/templates/wizards/classes/cpp/file.h3
-rw-r--r--share/qtcreator/templates/wizards/classes/cpp/wizard.json11
-rw-r--r--share/qtcreator/templates/wizards/projects/consoleapp/file.pro5
-rw-r--r--share/qtcreator/templates/wizards/projects/qtforpythonapplication/main_widget.py24
-rw-r--r--share/qtcreator/templates/wizards/projects/qtforpythonapplication/main_widget_gen.py39
-rw-r--r--share/qtcreator/templates/wizards/projects/qtforpythonapplication/widget/wizard.json4
-rw-r--r--share/qtcreator/templates/wizards/projects/qtforpythonapplication/widget_gen/main.pyproject3
-rw-r--r--share/qtcreator/templates/wizards/projects/qtforpythonapplication/widget_gen/wizard.json114
-rw-r--r--share/qtcreator/templates/wizards/projects/qtquickapplication/CMakeLists.6.x.txt33
-rw-r--r--share/qtcreator/templates/wizards/projects/qtquickapplication/CMakeLists.txt79
-rw-r--r--share/qtcreator/templates/wizards/projects/qtquickapplication/Main.qml.tpl (renamed from share/qtcreator/templates/wizards/projects/qtquickapplication/empty/main.qml.tpl)8
-rw-r--r--share/qtcreator/templates/wizards/projects/qtquickapplication/app.pro40
-rw-r--r--share/qtcreator/templates/wizards/projects/qtquickapplication/app.qbs48
-rw-r--r--share/qtcreator/templates/wizards/projects/qtquickapplication/empty/qml.qrc5
-rw-r--r--share/qtcreator/templates/wizards/projects/qtquickapplication/empty/wizard.json230
-rw-r--r--share/qtcreator/templates/wizards/projects/qtquickapplication/icon.png (renamed from share/qtcreator/templates/wizards/projects/qtquickapplication/empty/icon.png)bin228 -> 228 bytes
-rw-r--r--share/qtcreator/templates/wizards/projects/qtquickapplication/icon@2x.png (renamed from share/qtcreator/templates/wizards/projects/qtquickapplication/empty/icon@2x.png)bin392 -> 392 bytes
-rw-r--r--share/qtcreator/templates/wizards/projects/qtquickapplication/main.cpp48
-rw-r--r--share/qtcreator/templates/wizards/projects/qtquickapplication/tmpl.qbs21
-rw-r--r--share/qtcreator/templates/wizards/projects/qtquickapplication/wizard.json298
-rw-r--r--share/qtcreator/templates/wizards/projects/qtquickuiprototype/wizard.json73
22 files changed, 387 insertions, 702 deletions
diff --git a/share/qtcreator/templates/wizards/autotest/files/tst.txt b/share/qtcreator/templates/wizards/autotest/files/tst.txt
index 5852153e89..7e1bd4c46e 100644
--- a/share/qtcreator/templates/wizards/autotest/files/tst.txt
+++ b/share/qtcreator/templates/wizards/autotest/files/tst.txt
@@ -49,6 +49,9 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
# no need to copy around qml test files for shadow builds - just set the respective define
add_definitions(-DQUICK_TEST_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
+file(GLOB_RECURSE QML_FILES *.qml)
+add_custom_target(qmlfiles SOURCES ${QML_FILES})
+
@if "%{UseSetupCode}" === "true"
add_executable(%{TestCaseName} %{MainCppName}
setup.cpp setup.h)
diff --git a/share/qtcreator/templates/wizards/classes/cpp/file.h b/share/qtcreator/templates/wizards/classes/cpp/file.h
index df35bd553c..77f1b21351 100644
--- a/share/qtcreator/templates/wizards/classes/cpp/file.h
+++ b/share/qtcreator/templates/wizards/classes/cpp/file.h
@@ -32,6 +32,9 @@ class %{CN}
@if '%{AddQObjectMacro}'
Q_OBJECT
@endif
+@if '%{AddQmlElementMacro}'
+ QML_ELEMENT
+@endif
public:
@if '%{Base}' === 'QObject' || %{JS: Cpp.hasQObjectParent('%{Base}')}
explicit %{CN}(QObject *parent = nullptr);
diff --git a/share/qtcreator/templates/wizards/classes/cpp/wizard.json b/share/qtcreator/templates/wizards/classes/cpp/wizard.json
index 33ba82355a..9317c17598 100644
--- a/share/qtcreator/templates/wizards/classes/cpp/wizard.json
+++ b/share/qtcreator/templates/wizards/classes/cpp/wizard.json
@@ -147,6 +147,17 @@
}
},
{
+ "name": "AddQmlElementMacro",
+ "trDisplayName": "Add QML_ELEMENT",
+ "type": "CheckBox",
+ "data":
+ {
+ "checkedValue": "AddQmlElementMacro",
+ "uncheckedValue": "",
+ "checked": "%{JS: ['QQuickItem'].indexOf(value('Base')) >= 0 }"
+ }
+ },
+ {
"name": "Sp2",
"type": "Spacer"
},
diff --git a/share/qtcreator/templates/wizards/projects/consoleapp/file.pro b/share/qtcreator/templates/wizards/projects/consoleapp/file.pro
index 8cafd79b8b..d86283e2df 100644
--- a/share/qtcreator/templates/wizards/projects/consoleapp/file.pro
+++ b/share/qtcreator/templates/wizards/projects/consoleapp/file.pro
@@ -1,7 +1,6 @@
-QT -= gui
+QT = core
-CONFIG += c++17 console
-CONFIG -= app_bundle
+CONFIG += c++17 cmdline
# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
diff --git a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/main_widget.py b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/main_widget.py
index 02b7ab7911..bd7d4fa807 100644
--- a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/main_widget.py
+++ b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/main_widget.py
@@ -1,6 +1,4 @@
# This Python file uses the following encoding: utf-8
-import os
-from pathlib import Path
import sys
@if '%{BaseCB}' === 'QWidget'
@@ -12,9 +10,12 @@ from %{PySideVersion}.QtWidgets import QApplication, QMainWindow
@if '%{BaseCB}' === 'QDialog'
from %{PySideVersion}.QtWidgets import QApplication, QDialog
@endif
-from %{PySideVersion}.QtCore import QFile
-from %{PySideVersion}.QtUiTools import QUiLoader
+# Important:
+# You need to run the following command to generate the ui_form.py file
+# pyside6-uic form.ui -o ui_form.py, or
+# pyside2-uic form.ui -o ui_form.py
+from ui_form import Ui_%{Class}
@if '%{BaseCB}'
class %{Class}(%{BaseCB}):
@@ -23,19 +24,8 @@ class %{Class}:
@endif
def __init__(self, parent=None):
super().__init__(parent)
- self.load_ui()
-
- def load_ui(self):
- loader = QUiLoader()
- path = Path(__file__).resolve().parent / "form.ui"
-@if '%{PySideVersion}' === 'PySide6'
- ui_file = QFile(path)
-@else
- ui_file = QFile(str(path))
-@endif
- ui_file.open(QFile.ReadOnly)
- loader.load(ui_file, self)
- ui_file.close()
+ self.ui = Ui_%{Class}()
+ self.ui.setupUi(self)
if __name__ == "__main__":
diff --git a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/main_widget_gen.py b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/main_widget_gen.py
deleted file mode 100644
index bd7d4fa807..0000000000
--- a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/main_widget_gen.py
+++ /dev/null
@@ -1,39 +0,0 @@
-# This Python file uses the following encoding: utf-8
-import sys
-
-@if '%{BaseCB}' === 'QWidget'
-from %{PySideVersion}.QtWidgets import QApplication, QWidget
-@endif
-@if '%{BaseCB}' === 'QMainWindow'
-from %{PySideVersion}.QtWidgets import QApplication, QMainWindow
-@endif
-@if '%{BaseCB}' === 'QDialog'
-from %{PySideVersion}.QtWidgets import QApplication, QDialog
-@endif
-
-# Important:
-# You need to run the following command to generate the ui_form.py file
-# pyside6-uic form.ui -o ui_form.py, or
-# pyside2-uic form.ui -o ui_form.py
-from ui_form import Ui_%{Class}
-
-@if '%{BaseCB}'
-class %{Class}(%{BaseCB}):
-@else
-class %{Class}:
-@endif
- def __init__(self, parent=None):
- super().__init__(parent)
- self.ui = Ui_%{Class}()
- self.ui.setupUi(self)
-
-
-if __name__ == "__main__":
- app = QApplication(sys.argv)
- widget = %{Class}()
- widget.show()
-@if '%{PySideVersion}' === 'PySide6'
- sys.exit(app.exec())
-@else
- sys.exit(app.exec_())
-@endif
diff --git a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/widget/wizard.json b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/widget/wizard.json
index 1a8e1bd72c..951be73475 100644
--- a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/widget/wizard.json
+++ b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/widget/wizard.json
@@ -3,8 +3,8 @@
"supportedProjectTypes": [ "PythonProject" ],
"id": "F.QtForPythonApplicationWindowWidget",
"category": "F.ApplicationPySide",
- "trDescription": "Creates a Qt for Python application that includes a Qt Designer-based widget (.ui file) - Load the forms dynamically/at runtime",
- "trDisplayName": "Window UI - Dynamic load",
+ "trDescription": "Creates a Qt for Python application that includes a Qt Designer-based widget (ui file) - Requires .ui to Python conversion",
+ "trDisplayName": "Window UI",
"trDisplayCategory": "Application (Qt for Python)",
"icon": "../icons/icon.png",
"iconKind": "Themed",
diff --git a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/widget_gen/main.pyproject b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/widget_gen/main.pyproject
deleted file mode 100644
index 64c2987a8f..0000000000
--- a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/widget_gen/main.pyproject
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "files": ["%{SrcFileName}", "form.ui"]
-}
diff --git a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/widget_gen/wizard.json b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/widget_gen/wizard.json
deleted file mode 100644
index 3bfe3af638..0000000000
--- a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/widget_gen/wizard.json
+++ /dev/null
@@ -1,114 +0,0 @@
-{
- "version": 1,
- "supportedProjectTypes": [ "PythonProject" ],
- "id": "F.QtForPythonApplicationWindowWidgetGen",
- "category": "F.ApplicationPySide",
- "trDescription": "Creates a Qt for Python application that includes a Qt Designer-based widget (ui file) - Requires .ui to Python conversion",
- "trDisplayName": "Window UI",
- "trDisplayCategory": "Application (Qt for Python)",
- "icon": "../icons/icon.png",
- "iconKind": "Themed",
- "enabled": "%{JS: value('Plugins').indexOf('Python') >= 0 && (!value('Platform').length || ['Desktop', 'DockerDeviceType', 'GenericLinuxOsType'].includes(value('Platform')))}",
-
- "options":
- [
- { "key": "SrcFileName", "value": "%{MainFileName}" },
- { "key": "PyProjectFile", "value": "%{ProjectFileName}" }
- ],
-
- "pages":
- [
- {
- "trDisplayName": "Project Location",
- "trShortTitle": "Location",
- "typeId": "Project",
- "name": "ProjectPath"
- },
- {
- "trDisplayName": "Define Class",
- "trShortTitle": "Details",
- "typeId": "Fields",
- "data" :
- [
- {
- "name": "PySideVersion",
- "trDisplayName": "PySide version:",
- "type": "ComboBox",
- "data":
- {
- "index": 1,
- "items": [ "PySide2", "PySide6" ]
- }
- },
- {
- "name": "Class",
- "trDisplayName": "Class name:",
- "mandatory": true,
- "type": "LineEdit",
- "data":
- {
- "validator": "(?:(?:[a-zA-Z_][a-zA-Z_0-9]*::)*[a-zA-Z_][a-zA-Z_0-9]*|)",
- "trText": "%{JS: value('BaseCB') ? value('BaseCB').slice(1) : 'MyClass'}"
- }
-
- },
- {
- "name": "BaseCB",
- "trDisplayName": "Base class:",
- "type": "ComboBox",
- "data":
- {
- "items": [ "QWidget", "QDialog", "QMainWindow" ]
- }
- },
- {
- "name": "MainFileName",
- "type": "LineEdit",
- "trDisplayName": "Source file:",
- "mandatory": true,
- "data": { "trText": "%{JS: Cpp.classToFileName(value('Class'), Util.preferredSuffix('text/x-python'))}" }
- },
- {
- "name": "ProjectFileName",
- "type": "LineEdit",
- "trDisplayName": "Project file:",
- "mandatory": true,
- "data": { "trText": "%{JS: Util.fileName('%{ProjectName}', 'pyproject')}" }
- }
- ]
- },
- {
- "trDisplayName": "Project Management",
- "trShortTitle": "Summary",
- "typeId": "Summary"
- }
- ],
- "generators":
- [
- {
- "typeId": "File",
- "data":
- [
- {
- "source": "main.pyproject",
- "target": "%{PyProjectFile}",
- "openAsProject": true
- },
- {
- "source": "../main_widget_gen.py",
- "target": "%{SrcFileName}",
- "openInEditor": true
- },
- {
- "source": "../main_widget.ui",
- "target": "form.ui"
- },
- {
- "source": "../../git.ignore",
- "target": ".gitignore",
- "condition": "%{JS: !value('IsSubproject') && value('VersionControl') === 'G.Git'}"
- }
- ]
- }
- ]
-}
diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/CMakeLists.6.x.txt b/share/qtcreator/templates/wizards/projects/qtquickapplication/CMakeLists.6.x.txt
deleted file mode 100644
index 9d2fc4a82c..0000000000
--- a/share/qtcreator/templates/wizards/projects/qtquickapplication/CMakeLists.6.x.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-cmake_minimum_required(VERSION 3.16)
-
-project(%{ProjectName} VERSION 0.1 LANGUAGES CXX)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_CXX_STANDARD_REQUIRED ON)
-
-find_package(Qt6 6.2 COMPONENTS Quick REQUIRED)
-
-qt_add_executable(%{TargetName}
- main.cpp
-)
-
-qt_add_qml_module(%{TargetName}
- URI %{ProjectName}
- VERSION 1.0
- QML_FILES main.qml %{AdditionalQmlFiles}
-)
-
-set_target_properties(%{TargetName} PROPERTIES
- MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
- MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
- MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
- MACOSX_BUNDLE TRUE
- WIN32_EXECUTABLE TRUE
-)
-
-target_link_libraries(%{TargetName}
- PRIVATE Qt6::Quick)
-
-install(TARGETS %{TargetName}
- BUNDLE DESTINATION .
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/CMakeLists.txt b/share/qtcreator/templates/wizards/projects/qtquickapplication/CMakeLists.txt
index 3b5806eb09..1f196bef17 100644
--- a/share/qtcreator/templates/wizards/projects/qtquickapplication/CMakeLists.txt
+++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/CMakeLists.txt
@@ -1,67 +1,33 @@
-cmake_minimum_required(VERSION 3.14)
+cmake_minimum_required(VERSION 3.16)
project(%{ProjectName} VERSION 0.1 LANGUAGES CXX)
-set(CMAKE_AUTOUIC ON)
+@if !%{HasQSPSetup}
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-
-set(CMAKE_CXX_STANDARD 17)
+@endif
set(CMAKE_CXX_STANDARD_REQUIRED ON)
-@if %{HasTranslation}
-find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Quick LinguistTools)
-find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Quick LinguistTools)
+find_package(Qt6 %{MinimumSupportedQtVersion} REQUIRED COMPONENTS Quick)
-set(TS_FILES %{TsFileName})
+@if %{HasQSPSetup}
+@if %{UsesAutoResourcePrefix}
+qt_standard_project_setup(REQUIRES 6.5)
@else
-find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Quick)
-find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Quick)
+qt_standard_project_setup()
@endif
-
-set(PROJECT_SOURCES
- %{MainCppFileName}
- qml.qrc
- @if %{HasTranslation}
- ${TS_FILES}
- @endif
-)
-
-if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
- qt_add_executable(%{ProjectName}
- MANUAL_FINALIZATION
- ${PROJECT_SOURCES}
- )
-# Define target properties for Android with Qt 6 as:
-# set_property(TARGET %{ProjectName} APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR
-# ${CMAKE_CURRENT_SOURCE_DIR}/android)
-# For more information, see https://doc.qt.io/qt-6/qt-add-executable.html#target-creation
-@if %{HasTranslation}
-
- qt_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
@endif
-else()
- if(ANDROID)
- add_library(%{ProjectName} SHARED
- ${PROJECT_SOURCES}
- )
-# Define properties for Android with Qt 5 after find_package() calls as:
-# set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android")
- else()
- add_executable(%{ProjectName}
- ${PROJECT_SOURCES}
- )
- endif()
-@if %{HasTranslation}
- qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
-@endif
-endif()
+qt_add_executable(%{TargetName}
+ main.cpp
+)
-target_link_libraries(%{ProjectName}
- PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Quick)
+qt_add_qml_module(%{TargetName}
+ URI %{ProjectName}
+ VERSION 1.0
+ QML_FILES Main.qml
+)
-set_target_properties(%{ProjectName} PROPERTIES
+set_target_properties(%{TargetName} PROPERTIES
MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
@@ -69,11 +35,10 @@ set_target_properties(%{ProjectName} PROPERTIES
WIN32_EXECUTABLE TRUE
)
-install(TARGETS %{ProjectName}
+target_link_libraries(%{TargetName}
+ PRIVATE Qt6::Quick
+)
+
+install(TARGETS %{TargetName}
BUNDLE DESTINATION .
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
-
-if(QT_VERSION_MAJOR EQUAL 6)
- qt_import_qml_plugins(%{ProjectName})
- qt_finalize_executable(%{ProjectName})
-endif()
diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/empty/main.qml.tpl b/share/qtcreator/templates/wizards/projects/qtquickapplication/Main.qml.tpl
index 36607ad82e..e1a6ccc8c3 100644
--- a/share/qtcreator/templates/wizards/projects/qtquickapplication/empty/main.qml.tpl
+++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/Main.qml.tpl
@@ -1,9 +1,7 @@
-import QtQuick %{QtQuickVersion}
-@if !%{IsQt6}
-import QtQuick.Window %{QtQuickWindowVersion}
-@endif
+import QtQuick
+import QtQuick.Window
@if %{UseVirtualKeyboard}
-import %{QtQuickVirtualKeyboardImport}
+import QtQuick.VirtualKeyboard
@endif
Window {
diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/app.pro b/share/qtcreator/templates/wizards/projects/qtquickapplication/app.pro
deleted file mode 100644
index 1e0811386a..0000000000
--- a/share/qtcreator/templates/wizards/projects/qtquickapplication/app.pro
+++ /dev/null
@@ -1,40 +0,0 @@
-@if "%{UseVirtualKeyboard}" == "true"
-QT += quick virtualkeyboard
-@else
-QT += quick
-@endif
-@if !%{IsQt6}
-
-# You can make your code fail to compile if it uses deprecated APIs.
-# In order to do so, uncomment the following line.
-#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
-@endif
-
-SOURCES += \\
- %{MainCppFileName}
-
-@if %{IsQt6}
-resources.files = main.qml %{AdditionalQmlFiles}
-resources.prefix = /$${TARGET}
-RESOURCES += resources
-@else
-RESOURCES += qml.qrc
-@endif
-@if %{HasTranslation}
-
-TRANSLATIONS += \\
- %{TsFileName}
-CONFIG += lrelease
-CONFIG += embed_translations
-@endif
-
-# Additional import path used to resolve QML modules in Qt Creator's code model
-QML_IMPORT_PATH =
-
-# Additional import path used to resolve QML modules just for Qt Quick Designer
-QML_DESIGNER_IMPORT_PATH =
-
-# Default rules for deployment.
-qnx: target.path = /tmp/$${TARGET}/bin
-else: unix:!android: target.path = /opt/$${TARGET}/bin
-!isEmpty(target.path): INSTALLS += target
diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/app.qbs b/share/qtcreator/templates/wizards/projects/qtquickapplication/app.qbs
deleted file mode 100644
index 14025b37b8..0000000000
--- a/share/qtcreator/templates/wizards/projects/qtquickapplication/app.qbs
+++ /dev/null
@@ -1,48 +0,0 @@
-import qbs
-
-CppApplication {
-@if "%{UseVirtualKeyboard}" == "true"
- Depends { name: "Qt"; submodules: ["quick", "virtualkeyboard"] }
-@else
- Depends { name: "Qt.quick" }
-@endif
-
- install: true
-
- // Additional import path used to resolve QML modules in Qt Creator's code model
- property pathList qmlImportPaths: []
-@if !%{IsQt6}
-
- cpp.defines: [
- // You can make your code fail to compile if it uses deprecated APIs.
- // In order to do so, uncomment the following line.
- //"QT_DISABLE_DEPRECATED_BEFORE=0x060000" // disables all the APIs deprecated before Qt 6.0.0
- ]
-@endif
-
- files: [
- "%{MainCppFileName}",
-@if !%{IsQt6}
- "main.qml",
- "qml.qrc",
-@endif
-@if %{HasTranslation}
- "%{TsFileName}",
-@endif
- ]
- @if %{HasTranslation}
-
- Group {
- fileTagsFilter: "qm"
- Qt.core.resourcePrefix: "/i18n"
- fileTags: "qt.core.resource_data"
- }
-@endif
-@if %{IsQt6}
- Group {
- files: ["main.qml"%{AdditionalQmlFilesQbs}]
- Qt.core.resourcePrefix: "%{ProjectName}/"
- fileTags: ["qt.qml.qml", "qt.core.resource_data"]
- }
-@endif
-}
diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/empty/qml.qrc b/share/qtcreator/templates/wizards/projects/qtquickapplication/empty/qml.qrc
deleted file mode 100644
index 5f6483ac33..0000000000
--- a/share/qtcreator/templates/wizards/projects/qtquickapplication/empty/qml.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>main.qml</file>
- </qresource>
-</RCC>
diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/empty/wizard.json b/share/qtcreator/templates/wizards/projects/qtquickapplication/empty/wizard.json
deleted file mode 100644
index ca2eb44b28..0000000000
--- a/share/qtcreator/templates/wizards/projects/qtquickapplication/empty/wizard.json
+++ /dev/null
@@ -1,230 +0,0 @@
-{
- "version": 1,
- "supportedProjectTypes": [ "CMakeProjectManager.CMakeProject", "Qbs.QbsProject", "Qt4ProjectManager.Qt4Project" ],
- "id": "U.QtQuickApplicationEmpty",
- "category": "D.ApplicationQt",
- "trDescription": "Creates a Qt Quick application that contains an empty window.",
- "trDisplayName": "Qt Quick Application",
- "trDisplayCategory": "Application (Qt)",
- "icon": "icon.png",
- "iconKind": "Themed",
- "featuresRequired": [ "QtSupport.Wizards.FeatureQt.5.6" ],
- "enabled": "%{JS: value('Plugins').indexOf('QmakeProjectManager') >= 0 || value('Plugins').indexOf('QbsProjectManager') >= 0 || value('Plugins').indexOf('CMakeProjectManager') >= 0}",
-
- "options":
- [
- { "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": "IsQt6", "value": "%{JS: value('QtVersion').IsQt6}" },
- { "key": "MainCppFileName", "value": "%{JS: 'main.' + Util.preferredSuffix('text/x-c++src')}" },
- { "key": "QtQuickVersion", "value": "%{JS: value('QtVersion').QtQuickVersion}" },
- { "key": "QtQuickWindowVersion", "value": "%{JS: value('QtVersion').QtQuickWindowVersion}" },
- { "key": "QtQuickVirtualKeyboardImport", "value": "%{JS: value('QtVersion').QtQuickVirtualKeyboardImport}" },
- { "key": "QtQuickFeature", "value": "%{JS: (value('QtQuickVersion')=='') ? 'QtSupport.Wizards.FeatureQt.6.2' : 'QtSupport.Wizards.FeatureQtQuick.%{QtQuickVersion}'}" },
- { "key": "UseVirtualKeyboardByDefault", "value": "%{JS: value('Plugins').indexOf('Boot2Qt') >= 0 || value('Plugins').indexOf('Boot2QtQdb') >= 0}" },
- { "key": "HasTranslation", "value": "%{JS: value('TsFileName') !== ''}" },
- { "key": "SetQPAPhysicalSize", "value": "%{UseVirtualKeyboardByDefault}" },
- { "key": "AdditionalQmlFiles", "value": "" },
- { "key": "AdditionalQmlFilesQbs", "value": "" },
- { "key": "TargetName", "value": "%{JS: 'app' + value('ProjectName')}" }
- ],
-
- "pages":
- [
- {
- "trDisplayName": "Project Location",
- "trShortTitle": "Location",
- "typeId": "Project"
- },
- {
- "trDisplayName": "Define Build System",
- "trShortTitle": "Build System",
- "typeId": "Fields",
- "enabled": "%{JS: !value('IsSubproject')}",
- "data":
- [
- {
- "name": "BuildSystem",
- "trDisplayName": "Build system:",
- "type": "ComboBox",
- "persistenceKey": "BuildSystemType",
- "data":
- {
- "index": 1,
- "items":
- [
- {
- "trKey": "qmake",
- "value": "qmake",
- "condition": "%{JS: value('Plugins').indexOf('QmakeProjectManager') >= 0}"
- },
- {
- "trKey": "CMake",
- "value": "cmake",
- "condition": "%{JS: value('Plugins').indexOf('CMakeProjectManager') >= 0}"
- },
- {
- "trKey": "Qbs",
- "value": "qbs",
- "condition": "%{JS: value('Plugins').indexOf('QbsProjectManager') >= 0}"
- }
- ]
- }
- }
- ]
- },
- {
- "trDisplayName": "Define Project Details",
- "trShortTitle": "Details",
- "typeId": "Fields",
- "data":
- [
- {
- "name": "QtVersion",
- "trDisplayName": "Minimum required Qt version:",
- "type": "ComboBox",
- "persistenceKey": "QtQuick.minimumQtVersion",
- "data":
- {
- "index": 1,
- "items":
- [
- {
- "trKey": "Qt 6.2",
- "value":
- {
- "QtQuickVersion": "",
- "QtQuickWindowVersion": "",
- "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard",
- "IsQt6": true
- }
- },
- {
- "trKey": "Qt 5.15",
- "value":
- {
- "QtQuickVersion": "2.15",
- "QtQuickWindowVersion": "2.15",
- "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.15",
- "IsQt6": false
- }
- },
- {
- "trKey": "Qt 5.14",
- "value":
- {
- "QtQuickVersion": "2.14",
- "QtQuickWindowVersion": "2.14",
- "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.14",
- "IsQt6": false
- }
- },
- {
- "trKey": "Qt 5.13",
- "value":
- {
- "QtQuickVersion": "2.13",
- "QtQuickWindowVersion": "2.13",
- "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.4",
- "IsQt6": false
- }
- },
- {
- "trKey": "Qt 5.12",
- "value":
- {
- "QtQuickVersion": "2.12",
- "QtQuickWindowVersion": "2.12",
- "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.4",
- "IsQt6": false
- }
- }
- ]
- }
- },
- {
- "name": "UseVirtualKeyboard",
- "trDisplayName": "Use Qt Virtual Keyboard",
- "type": "CheckBox",
- "persistenceKey": "QtQuick.UseVirtualKeyboard.%{UseVirtualKeyboardByDefault}",
- "data":
- {
- "checked": "%{UseVirtualKeyboardByDefault}"
- }
- }
- ]
- },
- {
- "trDisplayName": "Translation File",
- "trShortTitle": "Translation",
- "typeId": "QtTranslation"
- },
- {
- "trDisplayName": "Kit Selection",
- "trShortTitle": "Kits",
- "typeId": "Kits",
- "enabled": "%{JS: !value('IsSubproject')}",
- "data": {
- "projectFilePath": "%{ProjectFile}",
- "requiredFeatures": [ "QtSupport.Wizards.FeatureQt", "%{QtQuickFeature}" ]
- }
- },
- {
- "trDisplayName": "Project Management",
- "trShortTitle": "Summary",
- "typeId": "Summary"
- }
- ],
- "generators":
- [
- {
- "typeId": "File",
- "data":
- [
- {
- "source": "../app.pro",
- "target": "%{ProFile}",
- "openAsProject": true,
- "condition": "%{JS: value('BuildSystem') === 'qmake'}"
- },
- {
- "source": "%{JS: value('QtVersion').IsQt6 ? '../CMakeLists.6.x.txt' : '../CMakeLists.txt'}",
- "target": "CMakeLists.txt",
- "openAsProject": true,
- "condition": "%{JS: value('BuildSystem') === 'cmake'}"
- },
- {
- "source": "../app.qbs",
- "target": "%{QbsFile}",
- "openAsProject": true,
- "condition": "%{JS: value('BuildSystem') === 'qbs'}"
- },
- {
- "source": "../main.cpp",
- "target": "%{MainCppFileName}"
- },
- {
- "source": "main.qml.tpl",
- "target": "main.qml",
- "openInEditor": true
- },
- {
- "source": "qml.qrc",
- "condition": "%{JS: !value('QtVersion').IsQt6}"
- },
- {
- "source": "../../translation.ts",
- "target": "%{TsFileName}",
- "condition": "%{HasTranslation}"
- },
- {
- "source": "../../git.ignore",
- "target": ".gitignore",
- "condition": "%{JS: !value('IsSubproject') && value('VersionControl') === 'G.Git'}"
- }
- ]
- }
- ]
-}
diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/empty/icon.png b/share/qtcreator/templates/wizards/projects/qtquickapplication/icon.png
index cb0a6d3b60..cb0a6d3b60 100644
--- a/share/qtcreator/templates/wizards/projects/qtquickapplication/empty/icon.png
+++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/icon.png
Binary files differ
diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/empty/icon@2x.png b/share/qtcreator/templates/wizards/projects/qtquickapplication/icon@2x.png
index 7b0df0dfa5..7b0df0dfa5 100644
--- a/share/qtcreator/templates/wizards/projects/qtquickapplication/empty/icon@2x.png
+++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/icon@2x.png
Binary files differ
diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/main.cpp b/share/qtcreator/templates/wizards/projects/qtquickapplication/main.cpp
index 08698bb6be..155667fb12 100644
--- a/share/qtcreator/templates/wizards/projects/qtquickapplication/main.cpp
+++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/main.cpp
@@ -1,9 +1,5 @@
%{Cpp:LicenseTemplate}\
%{JS: QtSupport.qtIncludes([], ["QtGui/QGuiApplication", "QtQml/QQmlApplicationEngine"])}
-@if %{HasTranslation}
-#include <QLocale>
-#include <QTranslator>
-@endif
int main(int argc, char *argv[])
{
@@ -11,48 +7,28 @@ int main(int argc, char *argv[])
qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard"));
@endif
-@if !%{IsQt6}
-@if %{SetQPAPhysicalSize}
- if (qEnvironmentVariableIsEmpty("QTGLESSTREAM_DISPLAY")) {
- qputenv("QT_QPA_EGLFS_PHYSICAL_WIDTH", QByteArray("213"));
- qputenv("QT_QPA_EGLFS_PHYSICAL_HEIGHT", QByteArray("120"));
-
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
-#endif
- }
-@else
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
-#endif
-@endif
-@endif
QGuiApplication app(argc, argv);
-@if %{HasTranslation}
-
- QTranslator translator;
- const QStringList uiLanguages = QLocale::system().uiLanguages();
- for (const QString &locale : uiLanguages) {
- const QString baseName = "%{JS: value('ProjectName') + '_'}" + QLocale(locale).name();
- if (translator.load(":/i18n/" + baseName)) {
- app.installTranslator(&translator);
- break;
- }
- }
-@endif
QQmlApplicationEngine engine;
-@if %{IsQt6}
- const QUrl url(u"qrc:/%{JS: value('ProjectName')}/main.qml"_qs);
-@else
- const QUrl url(QStringLiteral("qrc:/main.qml"));
+@if !%{HasLoadFromModule}
+ const QUrl url(u"qrc:/%{JS: value('ProjectName')}/Main.qml"_qs);
@endif
+@if %{HasFailureSignal}
+ QObject::connect(&engine, &QQmlApplicationEngine::objectCreationFailed,
+ &app, []() { QCoreApplication::exit(-1); },
+ Qt::QueuedConnection);
+@else
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
&app, [url](QObject *obj, const QUrl &objUrl) {
if (!obj && url == objUrl)
QCoreApplication::exit(-1);
}, Qt::QueuedConnection);
+@endif
+@if %{HasLoadFromModule}
+ engine.loadFromModule("%{JS: value('ProjectName')}", "Main");
+@else
engine.load(url);
+@endif
return app.exec();
}
diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/tmpl.qbs b/share/qtcreator/templates/wizards/projects/qtquickapplication/tmpl.qbs
new file mode 100644
index 0000000000..050ace8415
--- /dev/null
+++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/tmpl.qbs
@@ -0,0 +1,21 @@
+import qbs
+CppApplication {
+@if "%{UseVirtualKeyboard}" == "true"
+ Depends { name: "Qt"; submodules: ["quick", "virtualkeyboard"] }
+@else
+ Depends { name: "Qt.quick" }
+@endif
+ install: true
+ // Additional import path used to resolve QML modules in Qt Creator's code model
+ property pathList qmlImportPaths: []
+
+ files: [
+ "%{MainCppFileName}",
+ ]
+
+ Group {
+ Qt.core.resourcePrefix: "%{ProjectName}/"
+ fileTags: ["qt.qml.qml", "qt.core.resource_data"]
+ files: ["Main.qml"]
+ }
+}
diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/wizard.json b/share/qtcreator/templates/wizards/projects/qtquickapplication/wizard.json
new file mode 100644
index 0000000000..88d63e19f9
--- /dev/null
+++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/wizard.json
@@ -0,0 +1,298 @@
+{
+ "version": 1,
+ "supportedProjectTypes": [ "CMakeProjectManager.CMakeProject", "QbsProjectManager.QbsProject" ],
+ "id": "U.QtQuickApplicationEmpty",
+ "category": "D.ApplicationQt",
+ "trDescription": "Creates a Qt Quick application that contains an empty window. Optionally, you can create a Qt Design Studio project.",
+ "trDisplayName": "Qt Quick Application",
+ "trDisplayCategory": "Application (Qt)",
+ "icon": "icon.png",
+ "iconKind": "Themed",
+ "featuresRequired": [ "QtSupport.Wizards.FeatureQtQmlCMakeApi" ],
+ "enabled": "%{JS: value('Plugins').indexOf('CMakeProjectManager') >= 0 || value('Plugins').indexOf('QbsProjectManager') >= 0 }",
+
+ "options":
+ [
+ { "key": "ProjectFile", "value": "%{JS: value('BuildSystem') === 'cmake' ? '%{ProjectDirectory}/CMakeLists.txt' : '%{ProjectDirectory}/' + '%{ProjectName}'.toLowerCase() + '.qbs' }" },
+ { "key": "MainCppFileName", "value": "%{JS: 'main.' + Util.preferredSuffix('text/x-c++src') }" },
+ { "key": "UseVirtualKeyboardByDefault", "value": "%{JS: value('Plugins').indexOf('Boot2Qt') >= 0 || value('Plugins').indexOf('Boot2QtQdb') >= 0 }" },
+ { "key": "TargetName", "value": "%{JS: 'app' + value('ProjectName') }" },
+ { "key": "HasQSPSetup", "value": "%{JS: value('MinimumSupportedQtVersion') > '6.2' }"},
+ { "key": "HasFailureSignal", "value": "%{JS: value('MinimumSupportedQtVersion') > '6.3' }"},
+ { "key": "UsesAutoResourcePrefix", "value": "%{JS: value('MinimumSupportedQtVersion') > '6.4' && value('BuildSystem') === 'cmake' }"},
+ { "key": "HasLoadFromModule", "value": "%{JS: value('MinimumSupportedQtVersion') > '6.4' && value('UsesAutoResourcePrefix') }"},
+ { "key": "QdsWizardPath", "value": "%{IDE:ResourcePath}/qmldesigner/studio_templates/projects" },
+ { "key": "QdsProjectStyle", "value": "%{JS: value('BuildSystem') === 'cmake' ? %{QdsProjectStyleInput} : false }" },
+ { "key": "NoQdsProjectStyle", "value": "%{JS: !%{QdsProjectStyle} }" },
+
+ { "key": "ImportModuleName", "value": "%{ProjectName}" },
+ { "key": "ImportModuleVersion", "value": "" },
+ { "key": "IsQt6Project", "value": true },
+ { "key": "ProjectPluginClassName", "value": "%{ProjectName}Plugin" },
+ { "key": "ProjectPluginName", "value": "%{ProjectName}plugin" },
+ { "key": "QmlProjectFileName", "value": "%{JS: Util.fileName('%{ProjectName}', 'qmlproject')}" },
+ { "key": "QtQuickControlsStyle", "value": "Material" },
+ { "key": "QtQuickControlsStyleTheme", "value": "Light" },
+ { "key": "QtQuickVersion", "value": "6.2" },
+ { "key": "ScreenHeight", "value": 1080 },
+ { "key": "ScreenWidth", "value": 1920 },
+ { "key": "UIClassName", "value": "Screen01" },
+ { "key": "UIClassFileName", "value": "%{JS: Util.fileName('%{UIClassName}', 'ui.qml')}" }
+ ],
+
+ "pages":
+ [
+ {
+ "trDisplayName": "Project Location",
+ "trShortTitle": "Location",
+ "typeId": "Project"
+ },
+ {
+ "trDisplayName": "Define Build System",
+ "trShortTitle": "Build System",
+ "typeId": "Fields",
+ "enabled": "%{JS: ! %{IsSubproject}}",
+ "data":
+ [
+ {
+ "name": "BuildSystem",
+ "trDisplayName": "Build system:",
+ "type": "ComboBox",
+ "persistenceKey": "BuildSystemType",
+ "data":
+ {
+ "index": 0,
+ "items":
+ [
+ {
+ "trKey": "CMake",
+ "value": "cmake",
+ "condition": "%{JS: value('Plugins').indexOf('CMakeProjectManager') >= 0}"
+ },
+ {
+ "trKey": "Qbs",
+ "value": "qbs",
+ "condition": "%{JS: value('Plugins').indexOf('QbsProjectManager') >= 0}"
+ }
+ ]
+ }
+ }
+ ]
+ },
+ {
+ "trDisplayName": "Define Project Details",
+ "trShortTitle": "Details",
+ "typeId": "Fields",
+ "data":
+ [
+ {
+ "name": "QdsProjectStyleInput",
+ "trDisplayName": "Create a project that you can open in Qt Design Studio",
+ "trToolTip": "Create a project with a structure that is compatible both with Qt Design Studio (via .qmlproject) and with Qt Creator (via CMakeLists.txt). It contains a .ui.qml form that you can visually edit in Qt Design Studio.",
+ "type": "CheckBox",
+ "span": true,
+ "visible": "%{JS: value('BuildSystem') === 'cmake'}",
+ "persistenceKey": "QtQuick.QdsProjectStyle",
+ "data":
+ {
+ "checked": false
+ }
+ },
+ {
+ "name": "UseVirtualKeyboard",
+ "trDisplayName": "Use Qt Virtual Keyboard",
+ "type": "CheckBox",
+ "span": true,
+ "persistenceKey": "QtQuick.UseVirtualKeyboard",
+ "data":
+ {
+ "checked": "%{UseVirtualKeyboardByDefault}"
+ }
+ },
+ {
+ "name": "MinimumSupportedQtVersion",
+ "trDisplayName": "The minimum version of Qt you want to build the application for",
+ "type": "ComboBox",
+ "data":
+ {
+ "items": [ "6.2", "6.4", "6.5" ],
+ "index": 1
+ }
+ }
+ ]
+ },
+ {
+ "trDisplayName": "Kit Selection",
+ "trShortTitle": "Kits",
+ "typeId": "Kits",
+ "enabled": "%{JS: !value('IsSubproject')}",
+ "data": {
+ "projectFilePath": "%{ProjectFile}",
+ "requiredFeatures": [ "QtSupport.Wizards.FeatureQtQmlCMakeApi" ]
+ }
+ },
+ {
+ "trDisplayName": "Project Management",
+ "trShortTitle": "Summary",
+ "typeId": "Summary"
+ }
+ ],
+ "generators":
+ [
+ {
+ "typeId": "File",
+ "data":
+ [
+ {
+ "source": "CMakeLists.txt",
+ "openAsProject": true,
+ "condition": "%{JS: %{NoQdsProjectStyle} && value('BuildSystem') === 'cmake' }"
+ },
+ {
+ "source": "tmpl.qbs",
+ "target": "%{ProjectFile}",
+ "openAsProject": true,
+ "condition": "%{JS: value('BuildSystem') === 'qbs' }"
+ },
+ {
+ "source": "main.cpp",
+ "target": "%{MainCppFileName}",
+ "condition": "%{NoQdsProjectStyle}"
+ },
+ {
+ "source": "Main.qml.tpl",
+ "target": "Main.qml",
+ "openInEditor": true,
+ "condition": "%{NoQdsProjectStyle}"
+ },
+ {
+ "source": "../git.ignore",
+ "target": ".gitignore",
+ "condition": "%{JS: %{NoQdsProjectStyle} && !value('IsSubproject') && value('VersionControl') === 'G.Git' }"
+ }
+ ]
+ },
+ {
+ "typeId": "File",
+ "data":
+ [
+ {
+ "source": "%{QdsWizardPath}/common/app.qmlproject.tpl",
+ "target": "%{ProjectDirectory}/%{QmlProjectFileName}",
+ "condition": "%{QdsProjectStyle}"
+ },
+ {
+ "source": "%{QdsWizardPath}/common/CMakeLists.main.txt.tpl",
+ "target": "%{ProjectDirectory}/CMakeLists.txt",
+ "openAsProject": true,
+ "condition": "%{QdsProjectStyle}"
+ },
+ {
+ "source": "%{QdsWizardPath}/common/qmlmodules.tpl",
+ "target": "%{ProjectDirectory}/qmlmodules",
+ "condition": "%{QdsProjectStyle}"
+ },
+ {
+ "source": "%{QdsWizardPath}/common/qmlcomponents.tpl",
+ "target": "%{ProjectDirectory}/qmlcomponents",
+ "condition": "%{QdsProjectStyle}"
+ },
+ {
+ "source": "%{QdsWizardPath}/common/main.qml",
+ "target": "%{ProjectDirectory}/main.qml",
+ "condition": "%{QdsProjectStyle}"
+ },
+ {
+ "source": "%{QdsWizardPath}/common/qtquickcontrols2.conf.tpl",
+ "target": "%{ProjectDirectory}/qtquickcontrols2.conf",
+ "condition": "%{QdsProjectStyle}"
+ },
+ {
+ "source": "%{QdsWizardPath}/common/main.cpp.tpl",
+ "target": "%{ProjectDirectory}/src/main.cpp",
+ "condition": "%{QdsProjectStyle}"
+ },
+ {
+ "source": "%{QdsWizardPath}/common/app_environment.h.tpl",
+ "target": "%{ProjectDirectory}/src/app_environment.h",
+ "condition": "%{QdsProjectStyle}"
+ },
+ {
+ "source": "%{QdsWizardPath}/common/import_qml_plugins.h.tpl",
+ "target": "%{ProjectDirectory}/src/import_qml_plugins.h",
+ "condition": "%{QdsProjectStyle}"
+ },
+ {
+ "source": "%{QdsWizardPath}/common/import_qml_components_plugins.h.tpl",
+ "target": "%{ProjectDirectory}/src/import_qml_components_plugins.h",
+ "condition": "%{QdsProjectStyle}"
+ },
+ {
+ "source": "%{QdsWizardPath}/common/CMakeLists.content.txt.tpl",
+ "target": "%{ProjectDirectory}/content/CMakeLists.txt",
+ "condition": "%{QdsProjectStyle}"
+ },
+ {
+ "source": "%{QdsWizardPath}/common/App.qml.tpl",
+ "target": "%{ProjectDirectory}/content/App.qml",
+ "condition": "%{QdsProjectStyle}"
+ },
+ {
+ "source": "%{QdsWizardPath}/application/Screen01.ui.qml.tpl",
+ "target": "%{ProjectDirectory}/content/Screen01.ui.qml",
+ "condition": "%{QdsProjectStyle}"
+ },
+ {
+ "source": "%{QdsWizardPath}/common/fonts.txt",
+ "target": "%{ProjectDirectory}/content/fonts/fonts.txt",
+ "condition": "%{QdsProjectStyle}"
+ },
+ {
+ "source": "%{QdsWizardPath}/common/asset_imports.txt",
+ "target": "%{ProjectDirectory}/asset_imports/asset_imports.txt",
+ "condition": "%{QdsProjectStyle}"
+ },
+ {
+ "source": "%{QdsWizardPath}/common/CMakeLists.imports.txt.tpl",
+ "target": "%{ProjectDirectory}/imports/CMakeLists.txt",
+ "condition": "%{QdsProjectStyle}"
+ },
+ {
+ "source": "%{QdsWizardPath}/shared-plugin/name/CMakeLists.importmodule.txt.tpl",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/CMakeLists.txt",
+ "condition": "%{QdsProjectStyle}"
+ },
+ {
+ "source": "%{QdsWizardPath}/shared-plugin/name/importmodule.qmldir.tpl",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/qmldir",
+ "condition": "%{QdsProjectStyle}"
+ },
+ {
+ "source": "%{QdsWizardPath}/shared-plugin/name/Constants.qml.tpl",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/Constants.qml",
+ "condition": "%{QdsProjectStyle}"
+ },
+ {
+ "source": "%{QdsWizardPath}/shared-plugin/name/DirectoryFontLoader.qml.tpl",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/DirectoryFontLoader.qml",
+ "condition": "%{QdsProjectStyle}"
+ },
+ {
+ "source": "%{QdsWizardPath}/shared-plugin/name/EventListModel.qml.tpl",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/EventListModel.qml",
+ "condition": "%{QdsProjectStyle}"
+ },
+ {
+ "source": "%{QdsWizardPath}/shared-plugin/name/EventListSimulator.qml.tpl",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/EventListSimulator.qml",
+ "condition": "%{QdsProjectStyle}"
+ },
+ {
+ "source": "%{QdsWizardPath}/shared-plugin/name/designer/plugin.metainfo",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/designer/plugin.metainfo",
+ "condition": "%{QdsProjectStyle}"
+ }
+ ]
+ }
+ ]
+}
diff --git a/share/qtcreator/templates/wizards/projects/qtquickuiprototype/wizard.json b/share/qtcreator/templates/wizards/projects/qtquickuiprototype/wizard.json
index ac45450734..aba8309365 100644
--- a/share/qtcreator/templates/wizards/projects/qtquickuiprototype/wizard.json
+++ b/share/qtcreator/templates/wizards/projects/qtquickuiprototype/wizard.json
@@ -9,17 +9,12 @@
"icon": "qtquickuiprototype.png",
"iconKind": "Themed",
"enabled": "%{JS: value('Plugins').indexOf('QmlProjectManager') >= 0}",
- "featuresRequired": [ "QtSupport.Wizards.FeatureQtQuickProject", "QtSupport.Wizards.FeatureQt" ],
+ "featuresRequired": [ "QtSupport.Wizards.FeatureQtQuickProject", "QtSupport.Wizards.FeatureQtQuick.6" ],
"options":
[
{ "key": "QmlProjectFileName", "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'qmlproject')}" },
- { "key": "IsQt6", "value": "%{JS: value('QtVersion').IsQt6}" },
{ "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": "%{JS: (value('QtQuickVersion')=='') ? 'QtSupport.Wizards.FeatureQtQuick.6' : 'QtSupport.Wizards.FeatureQtQuick.%{QtQuickVersion}'}" },
{ "key": "UseVirtualKeyboardByDefault", "value": "%{JS: value('Plugins').indexOf('Boot2Qt') >= 0 || value('Plugins').indexOf('Boot2QtQdb') >= 0}" }
],
@@ -37,68 +32,6 @@
"data":
[
{
- "name": "QtVersion",
- "trDisplayName": "Minimum required Qt version:",
- "type": "ComboBox",
- "data":
- {
- "index": 1,
- "items":
- [
- {
- "trKey": "Qt 6",
- "value":
- {
- "QtQuickVersion": "",
- "QtQuickWindowVersion": "",
- "QtQuickVirtualKeyboardImport": "",
- "IsQt6": true
- }
- },
- {
- "trKey": "Qt 5.15",
- "value":
- {
- "QtQuickVersion": "2.15",
- "QtQuickWindowVersion": "2.15",
- "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.15",
- "IsQt6": false
- }
- },
- {
- "trKey": "Qt 5.14",
- "value":
- {
- "QtQuickVersion": "2.14",
- "QtQuickWindowVersion": "2.14",
- "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.14",
- "IsQt6": false
- }
- },
- {
- "trKey": "Qt 5.13",
- "value":
- {
- "QtQuickVersion": "2.13",
- "QtQuickWindowVersion": "2.13",
- "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.4",
- "IsQt6": false
- }
- },
- {
- "trKey": "Qt 5.12",
- "value":
- {
- "QtQuickVersion": "2.12",
- "QtQuickWindowVersion": "2.12",
- "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.4",
- "IsQt6": false
- }
- }
- ]
- }
- },
- {
"name": "UseVirtualKeyboard",
"trDisplayName": "Use Qt Virtual Keyboard",
"type": "CheckBox",
@@ -116,7 +49,7 @@
"enabled": "%{JS: ! %{IsSubproject}}",
"data": {
"projectFilePath": "%{QmlProjectFileName}",
- "requiredFeatures": [ "QtSupport.Wizards.FeatureQt", "%{QtQuickFeature}" ]
+ "requiredFeatures": [ "QtSupport.Wizards.FeatureQtQuickProject", "QtSupport.Wizards.FeatureQtQuick.6" ]
}
},
{
@@ -137,7 +70,7 @@
"openAsProject": true
},
{
- "source": "../qtquickapplication/empty/main.qml.tpl",
+ "source": "../qtquickapplication/Main.qml.tpl",
"target": "%{ProjectDirectory}/%{MainQmlFileName}",
"openInEditor": true
},