Applying MVVM pattern in a QtQuick

2019-03-16 03:57发布

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

Thanks

标签: qt mvvm qt-quick
1条回答
The star\"
2楼-- · 2019-03-16 05:02

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.

查看更多
登录 后发表回答