qml - 如何通过 id 获得属性列表
问题描述
我可以拥有一个使用以下列表的属性
property list<Rectangle> childRects: [
Rectangle { color: "red" },
Rectangle { color: "blue"}
]
我的元素比我的元素更长更复杂Rectangle
,我发现在属性中声明它们不是很可读。
我怎么能有类似的东西
property list<Rectangle> childRects: [rect1, rect2]
Rectangle {id: rect1; color: "red" },
Rectangle {if: rect2; color: "blue"}
解决方案
推荐阅读
- python - 根据 column1 的值将 column1 的值设置为 column2 的值
- c# - Regex.IsMatch 处理空值
- java - 使用 UniVocity 将带有集合的对象写入 CSV
- python-3.x - 无法 pip 安装 lxml
- reactjs - 多边形未出现在 react-google-maps 中
- node.js - 变量无法进入角度 5 剩余的视图 html 已满
- erlang - Erlang integers in list and use them in formula's
- ios - 如何将我的 SDK 框架项目的 .dsym 文件包含到 App 项目中?
- unity3d - Admob 测试 广告出现在模拟器上但不是真手机?
- angular - Angular 6关于多个模块的警告,其名称仅在大小写上有所不同