Applying MVVM pattern in a QtQuick

后端 未结 1 922
轻奢々
轻奢々 2021-02-06 08:21

How can i apply MVVM pattern in QtQuick applications?
Can anybody give me any sample (simple) code?

Thanks

相关标签:
1条回答
  • 2021-02-06 09:07

    With a C++ ViewModel

    I know someone has done the same thing with a QML ViewModel and bi-directional binding for the text element for example.

    Bi-directional binding is done through the binding of the text property to the viewmodel property. Then, add a Binding node to bind the viewmodel property to the text property of the textinput.

    0 讨论(0)
提交回复
热议问题