Applying MVVM pattern in a QtQuick

点点圈 提交于 2019-12-20 13:52:07

问题


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

Thanks


回答1:


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.



来源:https://stackoverflow.com/questions/8533859/applying-mvvm-pattern-in-a-qtquick

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!