"New Class" wizard: Add QML_ELEMENT checkbox

Change-Id: I219b539ba5f36c895be1042a74571e54a0c67ec6
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Tasuku Suzuki
2023-01-28 15:40:34 +09:00
parent 04f521abcf
commit 2f94e93334
2 changed files with 14 additions and 0 deletions

View File

@@ -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);

View File

@@ -146,6 +146,17 @@
"checked": "%{JS: [ 'QObject', 'QWidget', 'QMainWindow', 'QDeclarativeItem', 'QQuickItem'].indexOf(value('Base')) >= 0 }"
}
},
{
"name": "AddQmlElementMacro",
"trDisplayName": "Add QML_ELEMENT",
"type": "CheckBox",
"data":
{
"checkedValue": "AddQmlElementMacro",
"uncheckedValue": "",
"checked": "%{JS: ['QQuickItem'].indexOf(value('Base')) >= 0 }"
}
},
{
"name": "Sp2",
"type": "Spacer"