You could add the function in the code argument that you pass to createQmlObject.
var component = Qt.createQmObject('import QtQuick 2.2\nimport mysoft.labs.myObject 1.0\nMDObject{ function testFunction() { console.log("testFunction"); }',root);
component.testFunction();
var component = Qt.createQmObject('import QtQuick 2.2\nimport mysoft.labs.myObject 1.0\nMDObject{ function testFunction() { console.log("testFunction"); }',root);
component.testFunction();
To copy to clipboard, switch view to plain text mode
Cheers,
_
Bookmarks