summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/declarative/focus/Core/ListViewDelegate.qml58
-rw-r--r--examples/declarative/focus/Core/ListViews.qml6
2 files changed, 31 insertions, 33 deletions
diff --git a/examples/declarative/focus/Core/ListViewDelegate.qml b/examples/declarative/focus/Core/ListViewDelegate.qml
index 8f4763e..14e2548 100644
--- a/examples/declarative/focus/Core/ListViewDelegate.qml
+++ b/examples/declarative/focus/Core/ListViewDelegate.qml
@@ -1,42 +1,40 @@
import Qt 4.7
-Component {
- Item {
- id: container
- x: 5; width: ListView.view.width - 10; height: 60
+Item {
+ id: container
+ x: 5; width: ListView.view.width - 10; height: 60
- Rectangle {
- id: content
- anchors.centerIn: parent; width: container.width - 40; height: container.height - 10
- color: "transparent"
- smooth: true
- radius: 10
+ Rectangle {
+ id: content
+ anchors.centerIn: parent; width: container.width - 40; height: container.height - 10
+ color: "transparent"
+ smooth: true
+ radius: 10
- Rectangle { color: "#91AA9D"; x: 3; y: 3; width: parent.width - 6; height: parent.height - 6; radius: 8 }
- Text {
- text: "List element " + (index + 1); color: "#193441"; font.bold: false; anchors.centerIn: parent
- font.pixelSize: 14
- }
+ Rectangle { color: "#91AA9D"; x: 3; y: 3; width: parent.width - 6; height: parent.height - 6; radius: 8 }
+ Text {
+ text: "List element " + (index + 1); color: "#193441"; font.bold: false; anchors.centerIn: parent
+ font.pixelSize: 14
}
+ }
- MouseArea {
- id: mouseArea
- anchors.fill: parent
- hoverEnabled: true
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ hoverEnabled: true
- onClicked: {
- ListView.view.currentIndex = index
- container.forceFocus()
- }
+ onClicked: {
+ ListView.view.currentIndex = index
+ container.forceFocus()
}
+ }
- states: State {
- name: "active"; when: container.focus == true
- PropertyChanges { target: content; color: "#FCFFF5"; scale: 1.1 }
- }
+ states: State {
+ name: "active"; when: container.focus == true
+ PropertyChanges { target: content; color: "#FCFFF5"; scale: 1.1 }
+ }
- transitions: Transition {
- NumberAnimation { properties: "scale"; duration: 100 }
- }
+ transitions: Transition {
+ NumberAnimation { properties: "scale"; duration: 100 }
}
}
diff --git a/examples/declarative/focus/Core/ListViews.qml b/examples/declarative/focus/Core/ListViews.qml
index f4384c8..089f821 100644
--- a/examples/declarative/focus/Core/ListViews.qml
+++ b/examples/declarative/focus/Core/ListViews.qml
@@ -10,7 +10,7 @@ FocusScope {
y: wantsFocus ? 10 : 40; width: parent.width / 3; height: parent.height - 20
focus: true
KeyNavigation.up: gridMenu; KeyNavigation.left: contextMenu; KeyNavigation.right: list2
- model: 10
+ model: 10; cacheBuffer: 200
delegate: ListViewDelegate {}
Behavior on y {
@@ -22,7 +22,7 @@ FocusScope {
id: list2
y: wantsFocus ? 10 : 40; x: parent.width / 3; width: parent.width / 3; height: parent.height - 20
KeyNavigation.up: gridMenu; KeyNavigation.left: list1; KeyNavigation.right: list3
- model: 10
+ model: 10; cacheBuffer: 200
delegate: ListViewDelegate {}
Behavior on y {
@@ -34,7 +34,7 @@ FocusScope {
id: list3
y: wantsFocus ? 10 : 40; x: 2 * parent.width / 3; width: parent.width / 3; height: parent.height - 20
KeyNavigation.up: gridMenu; KeyNavigation.left: list2
- model: 10
+ model: 10; cacheBuffer: 200
delegate: ListViewDelegate {}
Behavior on y {