summaryrefslogtreecommitdiffstats
path: root/examples/declarative
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-10-27 01:47:16 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-10-27 01:47:16 (GMT)
commitbaedccfc09c3a95a7a900318cf384fd8a03e3eeb (patch)
treec922c2fc221ed11cb892bfa91f402caba895eb3a /examples/declarative
parentb1a5b6c40c6c76d44d9afc24c6cddf1d2abf7b29 (diff)
downloadQt-baedccfc09c3a95a7a900318cf384fd8a03e3eeb.zip
Qt-baedccfc09c3a95a7a900318cf384fd8a03e3eeb.tar.gz
Qt-baedccfc09c3a95a7a900318cf384fd8a03e3eeb.tar.bz2
Improve highlight range API and fix incorrect list end calc.
Diffstat (limited to 'examples/declarative')
-rw-r--r--examples/declarative/focusscope/test3.qml4
-rw-r--r--examples/declarative/listview/itemlist.qml4
-rw-r--r--examples/declarative/listview/listview.qml7
-rw-r--r--examples/declarative/parallax/ParallaxView.qml19
-rw-r--r--examples/declarative/parallax/parallax.qml49
5 files changed, 33 insertions, 50 deletions
diff --git a/examples/declarative/focusscope/test3.qml b/examples/declarative/focusscope/test3.qml
index e5aa7b6..1b3181b 100644
--- a/examples/declarative/focusscope/test3.qml
+++ b/examples/declarative/focusscope/test3.qml
@@ -40,8 +40,8 @@ Rectangle {
model: model
delegate: verticalDelegate
preferredHighlightBegin: 100
- preferredHighlightEnd: 101
- strictlyEnforceHighlightRange: true
+ preferredHighlightEnd: 100
+ highlightRangeMode: "StrictlyEnforceRange"
}
diff --git a/examples/declarative/listview/itemlist.qml b/examples/declarative/listview/itemlist.qml
index 6dfc90b..77f5c2d 100644
--- a/examples/declarative/listview/itemlist.qml
+++ b/examples/declarative/listview/itemlist.qml
@@ -30,8 +30,8 @@ Rectangle {
anchors.bottomMargin: 30
model: itemModel
preferredHighlightBegin: 0
- preferredHighlightEnd: 1
- strictlyEnforceHighlightRange: true
+ preferredHighlightEnd: 0
+ highlightRangeMode: "StrictlyEnforceRange"
orientation: "Horizontal"
}
diff --git a/examples/declarative/listview/listview.qml b/examples/declarative/listview/listview.qml
index 98974fd..b614904 100644
--- a/examples/declarative/listview/listview.qml
+++ b/examples/declarative/listview/listview.qml
@@ -41,7 +41,7 @@ Rectangle {
// current item within the the bounds of the range, however
// items will not scroll beyond the beginning or end of the view,
// forcing the highlight to move outside the range at the ends.
- // The third list sets strictlyEnforceHighlightRange to true
+ // The third list sets the highlightRangeMode to StrictlyEnforceRange
// and sets a range smaller than the height of an item. This
// forces the current item to change when the view is flicked,
// since the highlight is unable to move.
@@ -61,6 +61,7 @@ Rectangle {
model: MyPetsModel; delegate: petDelegate; highlight: petHighlight
preferredHighlightBegin: 80
preferredHighlightEnd: 220
+ highlightRangeMode: "ApplyRange"
currentIndex: list1.currentIndex
}
ListView {
@@ -69,7 +70,7 @@ Rectangle {
model: MyPetsModel; delegate: petDelegate; highlight: petHighlight
currentIndex: list1.currentIndex
preferredHighlightBegin: 125
- preferredHighlightEnd: 126
- strictlyEnforceHighlightRange: true
+ preferredHighlightEnd: 125
+ highlightRangeMode: "StrictlyEnforceRange"
}
}
diff --git a/examples/declarative/parallax/ParallaxView.qml b/examples/declarative/parallax/ParallaxView.qml
index 4ddab00..38bb8c0 100644
--- a/examples/declarative/parallax/ParallaxView.qml
+++ b/examples/declarative/parallax/ParallaxView.qml
@@ -10,7 +10,6 @@ Item {
width: Math.max(list.viewportWidth, parent.width)
}
- /*
default property alias content: visualModel.children
ListView {
id: list
@@ -21,21 +20,7 @@ Item {
highlight: Item { height: 1; width: 1}
preferredHighlightBegin: 0
- preferredHighlightEnd: 1
- strictlyEnforceHighlightRange: true
- }
- */
-
- default property alias content: flickArea.data
- Flickable {
- id: list
- anchors.fill: parent
- overShoot: false
- viewportWidth: flickArea.width
-
- Item {
- id: flickArea
- width: childrenRect.width
- }
+ preferredHighlightEnd: 0
+ highlightRangeMode: "StrictlyEnforceRange"
}
}
diff --git a/examples/declarative/parallax/parallax.qml b/examples/declarative/parallax/parallax.qml
index 9adcfd7..b2139ec 100644
--- a/examples/declarative/parallax/parallax.qml
+++ b/examples/declarative/parallax/parallax.qml
@@ -9,37 +9,34 @@ Rectangle {
anchors.fill: parent
background: "pics/background.jpg"
- Row {
- Item {
- width: 320
- height: 480
-
- Clock {
- anchors.centerIn: parent
- }
+ Item {
+ width: 320
+ height: 480
+
+ Clock {
+ anchors.centerIn: parent
}
+ }
- Item {
- width: 320
- height: 480
+ Item {
+ width: 320
+ height: 480
- Smiley {}
- }
+ Smiley {}
+ }
- Item {
- width: 320
- height: 480
-
- Loader {
- anchors.centerIn: parent
- width: 300; height: 460
- clip: true
- resizeMode: Loader.SizeItemToLoader
-
- source: "../../../demos/declarative/samegame/samegame.qml"
- }
+ Item {
+ width: 320
+ height: 480
+
+ Loader {
+ anchors.centerIn: parent
+ width: 300; height: 460
+ clip: true
+ resizeMode: Loader.SizeItemToLoader
+
+ source: "../../../demos/declarative/samegame/samegame.qml"
}
-
}
}