报错一
QML Standard: Detected anchors on an item that is managed by a layout. This is undefined behavior; use Layout.alignment instead.
当在 QML Layout
中使用anchors
的时候会报错
- 修改方法
anchors.top: parent.top
->Layout.alignment: Qt.AlignTop
anchors.topMargin: 14
->Layout.topMargin: 14
报错二
Cannot assign to non-existent property “top”
当使用RowLayout
或ColumnLayout
时,因为本身就会对齐,所以可以省略掉Layout.alignment: Qt.AlignTop
之类。
不然也会出现报错
Cannot assign to non-existent property "top"