diff options
author | Olivier Goffart <olivier.goffart@nokia.com> | 2010-11-12 14:33:33 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2010-11-12 14:33:33 (GMT) |
commit | 437e83e7707516129f68ee26aca5349845b7cc7b (patch) | |
tree | 0d4c8721f21acc5398e4eabff88a902cb23d0521 /examples | |
parent | 7b3880475d02bd3db630387bccccc7e1ef9d4e9a (diff) | |
parent | e61071a2a170eaeb524778e9e903100323b88bbe (diff) | |
download | Qt-437e83e7707516129f68ee26aca5349845b7cc7b.zip Qt-437e83e7707516129f68ee26aca5349845b7cc7b.tar.gz Qt-437e83e7707516129f68ee26aca5349845b7cc7b.tar.bz2 |
Merge remote branch 'origin/4.7' into qt-master-from-4.7
Conflicts:
configure
doc/src/snippets/code/doc_src_qmake-manual.qdoc
mkspecs/features/symbian/application_icon.prf
mkspecs/features/symbian/default_post.prf
mkspecs/features/symbian/symbian_building.prf
qmake/generators/symbian/initprojectdeploy_symbian.cpp
src/multimedia/audio/audio.pri
src/network/access/qnetworkaccessmanager.cpp
src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
src/opengl/qgl_p.h
src/plugins/bearer/corewlan/qcorewlanengine.mm
src/plugins/phonon/mmf/mmf.pro
tests/auto/qscriptvalue/tst_qscriptvalue.cpp
tests/auto/qscriptvalue/tst_qscriptvalue.h
tools/qdoc3/doc/qdoc-manual.qdocconf
Diffstat (limited to 'examples')
-rw-r--r-- | examples/declarative/cppextensions/plugins/README | 2 | ||||
-rw-r--r-- | examples/declarative/modelviews/listview/highlightranges.qml | 20 |
2 files changed, 12 insertions, 10 deletions
diff --git a/examples/declarative/cppextensions/plugins/README b/examples/declarative/cppextensions/plugins/README index fe519f8..95e0eea 100644 --- a/examples/declarative/cppextensions/plugins/README +++ b/examples/declarative/cppextensions/plugins/README @@ -5,5 +5,5 @@ by a C++ plugin (providing the "Time" type), and by QML files (providing the To run: make install - qml -I . plugins.qml + qmlviewer -I . plugins.qml diff --git a/examples/declarative/modelviews/listview/highlightranges.qml b/examples/declarative/modelviews/listview/highlightranges.qml index 2716ee5..58d37a3 100644 --- a/examples/declarative/modelviews/listview/highlightranges.qml +++ b/examples/declarative/modelviews/listview/highlightranges.qml @@ -42,15 +42,14 @@ import QtQuick 1.0 import "content" Rectangle { + id: root + property int current: 0 width: 600; height: 300 // This example shows the same model in three different ListView items, // with different highlight ranges. The highlight ranges are set by the // preferredHighlightBegin and preferredHighlightEnd properties in ListView. // - // The second and third ListViews set their currentIndex to be the - // same as the first. The first ListView is given keyboard focus. - // // The first ListView does not set a highlight range, so its currentItem // can move freely within the visible area. If it moves outside the // visible area, the view is automatically scrolled to keep the current @@ -66,9 +65,10 @@ Rectangle { // forces the current item to change when the view is flicked, // since the highlight is unable to move. // - // Note that the first ListView sets its currentIndex to be equal to - // the third ListView's currentIndex. By flicking the third ListView with - // the mouse, the current index of the first ListView will be changed. + // All ListViews bind their currentIndex to the root.current property. + // The first ListView sets root.current whenever its currentIndex changes + // due to keyboard interaction. + // Flicking the third ListView with the mouse also changes root.current. ListView { id: list1 @@ -77,7 +77,8 @@ Rectangle { delegate: petDelegate highlight: Rectangle { color: "lightsteelblue" } - currentIndex: list3.currentIndex + currentIndex: root.current + onCurrentIndexChanged: root.current = currentIndex focus: true } @@ -89,7 +90,7 @@ Rectangle { delegate: petDelegate highlight: Rectangle { color: "yellow" } - currentIndex: list1.currentIndex + currentIndex: root.current preferredHighlightBegin: 80; preferredHighlightEnd: 220 highlightRangeMode: ListView.ApplyRange } @@ -102,7 +103,8 @@ Rectangle { delegate: petDelegate highlight: Rectangle { color: "yellow" } - currentIndex: list1.currentIndex + currentIndex: root.current + onCurrentIndexChanged: root.current = currentIndex preferredHighlightBegin: 125; preferredHighlightEnd: 125 highlightRangeMode: ListView.StrictlyEnforceRange } |