summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/declarative
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2011-03-21 03:20:36 (GMT)
committerBea Lam <bea.lam@nokia.com>2011-03-21 03:30:11 (GMT)
commit40db21b1d8a020291f0a0660d30491b49f49885b (patch)
treee36531625ff4b35f227a4d31a6a443c30b2fcb6c /doc/src/snippets/declarative
parent9f99d85769b3c1c68dd8c9fd9afa1f09c9eeb2e9 (diff)
downloadQt-40db21b1d8a020291f0a0660d30491b49f49885b.zip
Qt-40db21b1d8a020291f0a0660d30491b49f49885b.tar.gz
Qt-40db21b1d8a020291f0a0660d30491b49f49885b.tar.bz2
fixes/improvements for new QML right-to-left docs
Clarify some of the docs and fix some broken doc links.
Diffstat (limited to 'doc/src/snippets/declarative')
-rw-r--r--doc/src/snippets/declarative/layoutmirroring.qml13
-rw-r--r--doc/src/snippets/declarative/righttoleft.qml27
2 files changed, 25 insertions, 15 deletions
diff --git a/doc/src/snippets/declarative/layoutmirroring.qml b/doc/src/snippets/declarative/layoutmirroring.qml
index 23eecd6..617f39d 100644
--- a/doc/src/snippets/declarative/layoutmirroring.qml
+++ b/doc/src/snippets/declarative/layoutmirroring.qml
@@ -43,18 +43,25 @@ import QtQuick 1.1
Rectangle {
LayoutMirroring.enabled: true
LayoutMirroring.childrenInherit: true
- width: 240; height: 50
+
+ width: 300; height: 50
+ color: "yellow"
+ border.width: 1
+
Row {
anchors { left: parent.left; margins: 5 }
y: 5; spacing: 5
+
Repeater {
model: 5
+
Rectangle {
color: "red"
- opacity: (5-index) / 5
+ opacity: (5 - index) / 5
width: 40; height: 40
+
Text {
- text: index+1
+ text: index + 1
anchors.centerIn: parent
}
}
diff --git a/doc/src/snippets/declarative/righttoleft.qml b/doc/src/snippets/declarative/righttoleft.qml
index 5d34f50..c2e504a 100644
--- a/doc/src/snippets/declarative/righttoleft.qml
+++ b/doc/src/snippets/declarative/righttoleft.qml
@@ -44,13 +44,13 @@ import "righttoleft"
Column {
width: 200
//![0]
-// aligned to the left
+// automatically aligned to the left
Text {
text: "Phone"
width: 200
}
-// aligned to the right
+// automatically aligned to the right
Text {
text: "خامل"
width: 200
@@ -73,20 +73,20 @@ Text {
//![0]
//![1]
-// by default positions child items from the left to right
+// by default child items are positioned from left to right
Row {
Child {}
Child {}
}
-// positions child items from the right to left
+// position child items from right to left
Row {
layoutDirection: Qt.RightToLeft
Child {}
Child {}
}
-// positions child items from the left to right
+// position child items from left to right
Row {
LayoutMirroring.enabled: true
layoutDirection: Qt.RightToLeft
@@ -97,12 +97,13 @@ Row {
//![2]
Item {
- // anchor left becomes right
height: 50; width: 150
+
LayoutMirroring.enabled: true
- anchors.left: parent.left
+ anchors.left: parent.left // anchor left becomes right
+
Row {
- // flows from the left to right
+ // items flow from left to right (as per default)
Child {}
Child {}
Child {}
@@ -112,13 +113,15 @@ Item {
//![3]
Item {
- // anchor left becomes right
height: 50; width: 150
+
LayoutMirroring.enabled: true
LayoutMirroring.childrenInherit: true
- anchors.left: parent.left
+ anchors.left: parent.left // anchor left becomes right
+
Row {
- // flows from the right to left
+ // setting childrenInherit in the parent causes these
+ // items to flow from right to left instead
Child {}
Child {}
Child {}
@@ -143,4 +146,4 @@ Image {
mirror: true
}
//![5]
-} \ No newline at end of file
+}