Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

[SOLVED]Dynamic Binding of QML Object and Factory created C++ object

$
0
0
GOT IT. this worked: onClicked: {     var component = Qt.createComponent("master_item.qml");     if (component.status == Component.Ready) {         var tab = tabview.addTab("tab " + (tabview.count + 1), component);         if (tab.status == Loader.Ready) {             tab.item.obj = products.get("CR2001W");         } else {             tab.loaded.connect(function() {                 console.log("this will be executed when corresponding tab is on focus");                 if (tab.status == Loader.Ready) {                     tab.item.obj = products.get("CR2001W");                 }             });         }     } } by extension, I should be putting callbacks on component.statusChanged as well… this gets ugly pretty fast. Refactor this on different JS file? how about my Products factory object? will it be available from js? Can I even put imports in plain js?

Viewing all articles
Browse latest Browse all 4972

Trending Articles