小编Bru*_*uce的帖子

QML: dynamically add Rectangle to a child of a component instance

I have an Component that I want to add content to dynamically:

MyThing.qml: 

Item{
    Rectangle {
        id: r1
    }
}

main.qml

MyThing {
    id: c1
}
Run Code Online (Sandbox Code Playgroud)

In the next line of code in main.qml how would I dynamically add a child rectangle to r1 in c1?

qml

5
推荐指数
1
解决办法
5147
查看次数

标签 统计

qml ×1