You could make the behaviour a property on the c++ side, which uses a string. The string could then be used to call a method.
// qml
Buttton {
onPressed: root['handle_' + nativeObject.behaviour]()
}
if behaviour would be ‘flash’ it would call root.handle_flash() JS function.
↧