Unsolved QML with PySide2
-
Hi
I am completely new to QML and PySide2. I am working on a desktop application where I want to make the UI using QML and connect it with PySide2. I saw some onlne documentation but was not able to find much about it. For an example, if I am creating a simple button using QML how can I access the button in PySide2. -
I'm new to QML too and I wish that I could help you~
To make a QML Button connect to a python method, you can follow these below:
1.Create a class that contains a python method decorated by "PySide2.QtCore.Slot";
2.Register the object of the class as a root context property;
3.Then you can call the python method in qml file.