我测试了这样一个简单的QML(Qt sdk版本5.3.2)程序
import QtQuick 2.3
import QtQuick.Controls 1.2
ApplicationWindow {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
id: appWin
Text {
text: qsTr("Hello World")
anchors.bottom: parent.bottom
}
}
Run Code Online (Sandbox Code Playgroud)
我希望文本将放在应用程序窗口的底部,这是有用的.但如果我anchors.bottom: parent.bottom改为anchors.bottom: appWin.bottom(通过id),锚点不再起作用,这是一个错误吗?