Hi, i want to append objects to a ListModel.
In the delegate there is a MouseArea.onClicked handle.
This handle should call a function that I want to pass to the model.
I tried to pass it to an object like this.
var obj = {"label":"OK","callback":function() {console.log('foobar')}};
bottonModel.append();
I can call callback() from obj. That works fine.
But in the delegate i can’t call callback() because “Property ‘callback’ of object [object Object] is not a function”.
Qml doesn’t pass the function as callable JS function. How can I pass a function to a dynamically created ListElement ?
↧