Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Applying MVVM pattern in a QtQuick

Tags:

mvvm

qt

qt-quick

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

Thanks

like image 618
S.M.Mousavi Avatar asked Dec 16 '11 12:12

S.M.Mousavi


1 Answers

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.

like image 107
flex Avatar answered Sep 28 '22 01:09

flex