Change context from qml

I am programming some kind of installer with PySide and QML. By design, it should be multi-page. And I want to separate the slots for calling from QML forms into different objects (ideally, into modules, but, as I understand it, an object with slots should inherit QObject, which modules cannot do). Therefore, when the page is changed, it is also necessary to change the "controller", but since I make it visible in QML using setContextProperty, I have a problem. Is there a way to call setContextProperty from QML? Or maybe a more correct way to do this exists? Thanks.

+6
source share
1 answer

It seems to me that you need some kind of "intermediary" object with functions defined as Q_INVOKABLE. So you set it for QML using setContextProperty and call these functions from QML as needed.

0
source

All Articles