我有这段 QML 代码:
Column {
spacing: units.gu(2)
anchors {
fill: parent
centerIn: parent
}
Row {
spacing: units.gu(4)
...
}
Row {
spacing: units.gu(4)
...
}
Row {
spacing: units.gu(4)
...
}
Row {
spacing: units.gu(4)
...
}
}
关于QML编程的最佳实践,如何重用代码以避免常见元素的重复属性?例如,在上面的示例中,避免在Rows中使用"spacing: units.gu(4)"。
About QML编程的最佳实践,如何重复使用代码以避免常见元素的重复属性?例如,对于上面的示例,避免在Rows中使用“spacing: units.gu(4)”。