我想将属性动态添加到 QML 元素:
Item {
id: dynamicProperty;
property int first;
Component.onCompleted: {
/* once this block of code is executed, i want to add
property int second; property bool third; property variant fourth;
*/
}
}
有什么办法可以完成上述任务。