summaryrefslogtreecommitdiffstats
path: root/examples/declarative
diff options
context:
space:
mode:
authorJoona Petrell <joona.t.petrell@nokia.com>2011-02-24 02:33:11 (GMT)
committerJoona Petrell <joona.t.petrell@nokia.com>2011-03-01 07:17:41 (GMT)
commit2c7cab4172f1acc86fd49345a2847417e162f2c3 (patch)
tree2df2e2bfccd17ed94980db0221ed3aec83afccb2 /examples/declarative
parenta4b37abd96860a5bc46f88205bb11706cbaec228 (diff)
downloadQt-2c7cab4172f1acc86fd49345a2847417e162f2c3.zip
Qt-2c7cab4172f1acc86fd49345a2847417e162f2c3.tar.gz
Qt-2c7cab4172f1acc86fd49345a2847417e162f2c3.tar.bz2
Add LayoutMirroring attached property for mirroring QML layouts
Task-number: QTBUG-17280 Reviewed-by: Martin Jones Change-Id: I34a623b49ce0fd5c05ae7a7ea5d0437c107b8a9b
Diffstat (limited to 'examples/declarative')
-rw-r--r--examples/declarative/positioners/layoutdirection/layoutdirection.qml22
1 files changed, 21 insertions, 1 deletions
diff --git a/examples/declarative/positioners/layoutdirection/layoutdirection.qml b/examples/declarative/positioners/layoutdirection/layoutdirection.qml
index 3e23b15..080010e 100644
--- a/examples/declarative/positioners/layoutdirection/layoutdirection.qml
+++ b/examples/declarative/positioners/layoutdirection/layoutdirection.qml
@@ -41,10 +41,13 @@
import QtQuick 1.1
Rectangle {
+ property bool mirror
+ property int direction: Qt.application.layoutDirection
+ LayoutMirroring.enabled: mirror
+ LayoutMirroring.childrenInherit: true
width: column.width + 100
height: column.height + 100
- property int direction: Qt.application.layoutDirection
Column {
id: column
@@ -133,6 +136,23 @@ Rectangle {
anchors.fill: parent
}
}
+ Rectangle {
+ height: 50; width: parent.width
+ color: mouseArea2.pressed ? "black" : "gray"
+ Text {
+ text: mirror ? "Mirrored" : "Normal"
+ color: "white"
+ font.pixelSize: 16
+ anchors.centerIn: parent
+ }
+ MouseArea {
+ id: mouseArea2
+ onClicked: {
+ mirror = !mirror;
+ }
+ anchors.fill: parent
+ }
+ }
}
Component {