【Qt】【QML】-Unable to assign double to QQuickAnchorLine
界面布局时,为了计算位置,报错了。
Rectangle {
id: rectangle_tab_bar
//x: 0
//y: 972
width: 1538
height: 60
anchors.top: parent.bottom - height
...
}
有两种方法修改:
1.修改y坐标
Rectangle {
id: rectangle_tab_bar
//x: 0
y: 972
width: 1538
height: 60
//anchors.top: parent.bottom - height
...
}
2.添加topMargin
Rectangle {
id: rectangle_tab_bar
//x: 0
//y: 972
width: 1538
height: 60
anchors.top: parent.bottom
anchors.topMargin: - height
...
}
= = =