How to Binding a C++ class member to qml UI element property
Unsolved
QML and Qt Quick
-
wrote on 18 Apr 2016, 06:35 last edited by
Can QML Binding type can achieve bind a c++ class member to qml UI property like MS UWP‘s DataBinding
Binding { target: text // a textblock property: "text" //the text property of textblock value: viewModel.cnt // a c++ class property exposed to qml }
-
wrote on 19 Apr 2016, 14:56 last edited by JordanHarris
You can make C++ members act as properties by using the Q_PROPERTY macro. Check out this page. It makes working between Qml and C++ quite intuitive.
1/2