什么是父母MouseArea
,什么时候在GroupBox
?parent
指一些container
:
GroupBox {
width: 100; height: 100
id: rec
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.LeftButton | Qt.RightButton
onClicked: {
console.log("\tparent" + parent + "\trec" + rec)
}
}
}
qml:父QQuickItem_QML_15(0x3ad3590,“容器”)recGroupBox_QMLTYPE_12(0x3ad2790)
当MouseArea
中的Rectangle
,Rectangle
是它的父级时:
Rectangle {
width: 100; height: 100
id: rec
color: "green"
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.LeftButton | Qt.RightButton
onClicked: {
console.log("\tparent" + parent + "\trec" + rec)
}
}
}
qml:父QQuickRectangle(0x39d0cd0)recQQuickRectangle(0x39d0cd0)