forked from qt-creator/qt-creator
Fix the Python templates
This fixes the templates so that they do not produce any warnings and also includes QQuickItem in the choice of base classes Change-Id: I58bbd462052f5d2a64bb8c4bea5bbdcd15e66700 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
This commit is contained in:
@@ -21,6 +21,7 @@ from PyQt5 import QtQuick
|
|||||||
@endif
|
@endif
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
|
||||||
@if '%{Base}'
|
@if '%{Base}'
|
||||||
class %{Class}(%{Base}):
|
class %{Class}(%{Base}):
|
||||||
@else
|
@else
|
||||||
@@ -29,11 +30,9 @@ class %{Class}:
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
@if '%{Base}' === 'QWidget'
|
@if '%{Base}' === 'QWidget'
|
||||||
QtWidgets.QWidget.__init__(self)
|
QtWidgets.QWidget.__init__(self)
|
||||||
@endif
|
@elif '%{Base}' === 'QMainWindow'
|
||||||
@if '%{Base}' === 'QMainWindow'
|
|
||||||
QtWidgets.QMainWindow.__init__(self)
|
QtWidgets.QMainWindow.__init__(self)
|
||||||
@if '%{Base}' === 'QQuickItem'
|
@elif '%{Base}' === 'QQuickItem'
|
||||||
QtQuick.QQuickItem.__init__(self)
|
QtQuick.QQuickItem.__init__(self)
|
||||||
@endif
|
@endif
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@@ -46,7 +46,7 @@
|
|||||||
"data":
|
"data":
|
||||||
{
|
{
|
||||||
"items": [ { "trKey": "<Custom>", "value": "" },
|
"items": [ { "trKey": "<Custom>", "value": "" },
|
||||||
"QObject", "QWidget", "QMainWindow", "QDeclarativeItem" ]
|
"QObject", "QWidget", "QMainWindow", "QDeclarativeItem", "QQuickItem" ]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
# This Python file uses the following encoding: utf-8
|
# This Python file uses the following encoding: utf-8
|
||||||
|
|
||||||
# if__name__ == "__main__":
|
# if __name__ == "__main__":
|
||||||
# pass
|
# pass
|
||||||
|
Reference in New Issue
Block a user