Error: Unqualified access [unqualified]
-
Can anyone tell me what the problem is? Python methods he sees, tried to paste mainwindows.backend
// main.qml ApplicationWindow { id: mainwindows visible: true flags: Qt.FramelessWindowHint width: Screen.width height: Screen.height title: "HelloApp" property var conts: backend // there is a problem here Unqualified access [unqualified]
# python if __name__ == "__main__": app = QApplication(sys.argv) engine = QQmlApplicationEngine() controller = MainWindow() engine.rootContext().setContextProperty("backend", controller) print("Controller registered:", bool(controller)) engine.load("main.qml") sys.exit(app.exec())
-
Hi,
Shouldn't that be const ? You wrote conts.
-
Using setContextProperty is not recommended anymore. Use a QML singleton or setInitialProperties on the engine.
-
Using setContextProperty is not recommended anymore. Use a QML singleton or setInitialProperties on the engine.
-
D DeSGuN has marked this topic as solved