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
|
||||
|
||||
|
||||
@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
|
||||
|
||||
|
@@ -46,7 +46,7 @@
|
||||
"data":
|
||||
{
|
||||
"items": [ { "trKey": "<Custom>", "value": "" },
|
||||
"QObject", "QWidget", "QMainWindow", "QDeclarativeItem" ]
|
||||
"QObject", "QWidget", "QMainWindow", "QDeclarativeItem", "QQuickItem" ]
|
||||
}
|
||||
},
|
||||
{
|
||||
|
Reference in New Issue
Block a user