From 12c74ff618b9cfdc03ccacc4262a02a7ecf1e846 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Fri, 2 Mar 2012 11:05:10 +1000 Subject: Update positioners examples to new guidelines Change-Id: I197a94bca26adbb79f1822b693fa73109db5a4ac Reviewed-by: Yann Bodson --- .../positioners/positioners-attachedproperties.qml | 43 ++++++++++++++++++---- 1 file changed, 35 insertions(+), 8 deletions(-) (limited to 'examples/quick/positioners/positioners-attachedproperties.qml') diff --git a/examples/quick/positioners/positioners-attachedproperties.qml b/examples/quick/positioners/positioners-attachedproperties.qml index a05927f5ea..af1124368d 100644 --- a/examples/quick/positioners/positioners-attachedproperties.qml +++ b/examples/quick/positioners/positioners-attachedproperties.qml @@ -41,12 +41,12 @@ import QtQuick 2.0 Rectangle { - width: 400 - height: 100 + width: 320 + height: 480 - // Create row with four rectangles, the fourth one is hidden - Row { - id: row + // Create column with four rectangles, the fourth one is hidden + Column { + id: column Rectangle { id: red @@ -54,10 +54,19 @@ Rectangle { width: 100 height: 100 + Text { + anchors.left: parent.right + anchors.leftMargin: 20 + anchors.verticalCenter: parent.verticalCenter + text: "Index: " + parent.Positioner.index + + (parent.Positioner.isFirstItem ? " (First)" : "") + + (parent.Positioner.isLastItem ? " (Last)" : "") + } + // When mouse is clicked, display the values of the positioner MouseArea { anchors.fill: parent - onClicked: row.showInfo(red.Positioner) + onClicked: column.showInfo(red.Positioner) } } @@ -67,10 +76,19 @@ Rectangle { width: 100 height: 100 + Text { + anchors.left: parent.right + anchors.leftMargin: 20 + anchors.verticalCenter: parent.verticalCenter + text: "Index: " + parent.Positioner.index + + (parent.Positioner.isFirstItem ? " (First)" : "") + + (parent.Positioner.isLastItem ? " (Last)" : "") + } + // When mouse is clicked, display the values of the positioner MouseArea { anchors.fill: parent - onClicked: row.showInfo(green.Positioner) + onClicked: column.showInfo(green.Positioner) } } @@ -80,10 +98,19 @@ Rectangle { width: 100 height: 100 + Text { + anchors.left: parent.right + anchors.leftMargin: 20 + anchors.verticalCenter: parent.verticalCenter + text: "Index: " + parent.Positioner.index + + (parent.Positioner.isFirstItem ? " (First)" : "") + + (parent.Positioner.isLastItem ? " (Last)" : "") + } + // When mouse is clicked, display the values of the positioner MouseArea { anchors.fill: parent - onClicked: row.showInfo(blue.Positioner) + onClicked: column.showInfo(blue.Positioner) } } -- cgit v1.2.3