1// This example demonstrates how item positioning 2// changes in right-to-left layout direction 3 4import QtQuick 1.1 5 6Rectangle { 7 color: "lightgray" 8 width: 640 9 height: 320 10 11 VisualItemModel { 12 id: itemModel 13 objectName: "itemModel" 14 Rectangle { 15 objectName: "item1" 16 height: view.height; width: 100; color: "#FFFEF0" 17 Text { objectName: "text1"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent } 18 } 19 Rectangle { 20 objectName: "item2" 21 height: view.height; width: 200; color: "#F0FFF7" 22 Text { objectName: "text2"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent } 23 } 24 Rectangle { 25 objectName: "item3" 26 height: view.height; width: 240; color: "#F4F0FF" 27 Text { objectName: "text3"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent } 28 } 29 } 30 31 ListView { 32 id: view 33 objectName: "view" 34 anchors.fill: parent 35 anchors.bottomMargin: 30 36 model: itemModel 37 highlightRangeMode: "StrictlyEnforceRange" 38 orientation: ListView.Horizontal 39 flickDeceleration: 2000 40 layoutDirection: Qt.RightToLeft 41 } 42} 43