You anchor to a parent like this: anchors.top: parent.top
Check out the documentation here: http://doc.qt.nokia.com/4.7-snapshot/anchor-layout.html On Tue, Jul 13, 2010 at 2:46 AM, Jason H <[email protected]> wrote: > Hi again. I am trying to anchor to parent > |A | > | B| > |C | > > With the rect being the parent. But I get the message: "QML Text: Cannot > anchor > to a null item." > > > importQt4.7 > Rectangle { > width: 1024 > height:768 > gradient: Gradient { > GradientStop { position: 0; color: "Navy"} > GradientStop { position: 1; color: "Black"} > } > //Font { id: third; family: "NiteClub"; pointSize:30; color: > "White"} > Text { > text: "A"; font.family: "NiteClub"; font.pointSize:30; > color: "White"; > anchors.top:parent.anchors.top; > anchors.left: parent.anchors.left > } > Text { > text: "B"; font.family: "NiteClub"; font.pointSize:30; > color: "White"; > anchors.verticalCenter:parent.anchors.verticalCenter; > anchors.right:parent.anchors.right > } > Text { > text: "C"; font.family: "NiteClub"; font.pointSize:30; > color: "White"; > anchors.bottom:parent.anchors.bottom; > anchors.left:parent.anchors.left > } > } > > > > > _______________________________________________ > Qt-qml mailing list > [email protected] > http://lists.trolltech.com/mailman/listinfo/qt-qml >
_______________________________________________ Qt-qml mailing list [email protected] http://lists.trolltech.com/mailman/listinfo/qt-qml
