aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--share/qtcreator/templates/wizards/classes/python/file.py7
-rw-r--r--share/qtcreator/templates/wizards/classes/python/wizard.json2
-rw-r--r--share/qtcreator/templates/wizards/files/python/file.py2
3 files changed, 5 insertions, 6 deletions
diff --git a/share/qtcreator/templates/wizards/classes/python/file.py b/share/qtcreator/templates/wizards/classes/python/file.py
index adcbc1ed2d..5698022dd8 100644
--- a/share/qtcreator/templates/wizards/classes/python/file.py
+++ b/share/qtcreator/templates/wizards/classes/python/file.py
@@ -21,6 +21,7 @@ from PyQt5 import QtQuick
@endif
@endif
+
@if '%{Base}'
class %{Class}(%{Base}):
@else
@@ -29,11 +30,9 @@ class %{Class}:
def __init__(self):
@if '%{Base}' === 'QWidget'
QtWidgets.QWidget.__init__(self)
-@endif
-@if '%{Base}' === 'QMainWindow'
+@elif '%{Base}' === 'QMainWindow'
QtWidgets.QMainWindow.__init__(self)
-@if '%{Base}' === 'QQuickItem'
+@elif '%{Base}' === 'QQuickItem'
QtQuick.QQuickItem.__init__(self)
@endif
pass
-
diff --git a/share/qtcreator/templates/wizards/classes/python/wizard.json b/share/qtcreator/templates/wizards/classes/python/wizard.json
index 552c3f15a0..aeebd1f2a3 100644
--- a/share/qtcreator/templates/wizards/classes/python/wizard.json
+++ b/share/qtcreator/templates/wizards/classes/python/wizard.json
@@ -46,7 +46,7 @@
"data":
{
"items": [ { "trKey": "<Custom>", "value": "" },
- "QObject", "QWidget", "QMainWindow", "QDeclarativeItem" ]
+ "QObject", "QWidget", "QMainWindow", "QDeclarativeItem", "QQuickItem" ]
}
},
{
diff --git a/share/qtcreator/templates/wizards/files/python/file.py b/share/qtcreator/templates/wizards/files/python/file.py
index 003f841497..fcb605f9f7 100644
--- a/share/qtcreator/templates/wizards/files/python/file.py
+++ b/share/qtcreator/templates/wizards/files/python/file.py
@@ -1,4 +1,4 @@
# This Python file uses the following encoding: utf-8
-# if__name__ == "__main__":
+# if __name__ == "__main__":
# pass