diff options
author | Joona Petrell <joona.t.petrell@nokia.com> | 2011-02-24 02:33:11 (GMT) |
---|---|---|
committer | Joona Petrell <joona.t.petrell@nokia.com> | 2011-03-01 07:17:41 (GMT) |
commit | 2c7cab4172f1acc86fd49345a2847417e162f2c3 (patch) | |
tree | 2df2e2bfccd17ed94980db0221ed3aec83afccb2 /examples/declarative | |
parent | a4b37abd96860a5bc46f88205bb11706cbaec228 (diff) | |
download | Qt-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.qml | 22 |
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 { |