forked from qt-creator/qt-creator
"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:
@@ -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);
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user