Files
qt-creator/share/qtcreator/templates/wizards/classes/python/file.py
Andy Shaw e22eea1cf3 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>
2020-02-18 16:13:20 +00:00

39 lines
828 B
Python

# This Python file uses the following encoding: utf-8
@if '%{Module}' === 'PySide2'
@if '%{ImportQtCore}'
from PySide2 import QtCore
@endif
@if '%{ImportQtWidgets}'
from PySide2 import QtWidgets
@endif
@if '%{ImportQtQuick}'
from PySide2 import QtQuick
@endif
@else
@if '%{ImportQtCore}'
from PyQt5 import QtCore
@endif
@if '%{ImportQtWidgets}'
from PyQt5 import QtWidgets
@endif
@if '%{ImportQtQuick}'
from PyQt5 import QtQuick
@endif
@endif
@if '%{Base}'
class %{Class}(%{Base}):
@else
class %{Class}:
@endif
def __init__(self):
@if '%{Base}' === 'QWidget'
QtWidgets.QWidget.__init__(self)
@elif '%{Base}' === 'QMainWindow'
QtWidgets.QMainWindow.__init__(self)
@elif '%{Base}' === 'QQuickItem'
QtQuick.QQuickItem.__init__(self)
@endif
pass