Reputation: 16748
I'm creating Tab
s in a TabView
dynamically via
var component = Qt.createComponent("file://tabcontent.qml"));
tabView.addTab(component);
However their code is not executed before I click on the Tab
itself.
How can I solve this?
Upvotes: 1
Views: 725
Reputation: 1273
The created Tab
inherits from Loader
with its active
property set to false
until the Tab
is clicked. Just explicitly set the active
property after creating it:
var component = Qt.createComponent("file://tabcontent.qml'));
var tab = tabView.addTab(component);
tab.active = true;
Upvotes: 4