summaryrefslogtreecommitdiffstats
path: root/examples/declarative/righttoleft/layoutdirection/layoutdirection.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/righttoleft/layoutdirection/layoutdirection.qml')
-rw-r--r--examples/declarative/righttoleft/layoutdirection/layoutdirection.qml12
1 files changed, 11 insertions, 1 deletions
diff --git a/examples/declarative/righttoleft/layoutdirection/layoutdirection.qml b/examples/declarative/righttoleft/layoutdirection/layoutdirection.qml
index 3044430..fa343b9 100644
--- a/examples/declarative/righttoleft/layoutdirection/layoutdirection.qml
+++ b/examples/declarative/righttoleft/layoutdirection/layoutdirection.qml
@@ -226,7 +226,17 @@ Rectangle {
Component {
id: viewDelegate
Item {
- width: (listView.effectiveLayoutDirection == Qt.LeftToRight ? (index == 48 - 1) : (index == 0)) ? 40 : 50
+ function effectiveLayoutDirection() {
+ if (LayoutMirroring.enabled)
+ if (listView.layoutDirection == Qt.LeftToRight)
+ return Qt.RightToLeft;
+ else
+ return Qt.LeftToRight;
+ else
+ return listView.layoutDirection;
+ }
+
+ width: (effectiveLayoutDirection() == Qt.LeftToRight ? (index == 48 - 1) : (index == 0)) ? 40 : 50
Rectangle {
width: 40; height: 40
color: Qt.rgba(0.5+(48 - index)*Math.random()/48,