self.engine = QQmlApplicationEngine(self)
self.engine.load(QUrl.fromLocalFile('main.qml'))
self.window = self.engine.rootObjects()[0]

def show(self):
    self.window.show()
QQuickView only supports loading of root objects that derive from QQuickItem error?