qt - How to access the public properties of a qml page loaded through a Loader? -
aa.qml
item { id: drawlinesonc property string linecolour property int linedrawingsourcetype property variant startendpointarray }
main.qml
loader { id: drawlineloadera source: "aa.qml" }
-
how access public properties of aa.qml
page loaded through loader drawlineloadera
?
solution follows:
drawlineloadera.source = "drawlineloader.qml" if (drawlineloadera.status == loader.ready) { if (drawlineloadera.item && drawlineloadera.item.linecolour) { drawlineloadera.item.linecolour = "black" drawlineloadera.item.linedrawingsourcetype = 2 } }
Comments
Post a Comment