PDA

View Full Version : Using Qt.binding() when the function has parameters



mut
10th August 2017, 08:04
Hello

How to use Qt.binding() when the function to wrap has parameters.

In both QML and JS files:

Component.onCompleted: {
color = Qt.binding(function(myValue) {
return my_exposed_cpp_object.my_function((myValue);
});
}

Will this force the reevalution each time myValue changes.

Thanks;

Mut.

mut
10th August 2017, 22:20
Can I use Qt.binding() in a IF staetment. Example:

if (Qt.binding(function(myValue) {
return my_exposed_cpp_object.my_function((myValue);
) {
}