summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativelistview.cpp
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-06-23 23:27:08 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-06-23 23:27:08 (GMT)
commit168abf1f3165f0a6d83f747c46f3d3241b1a405f (patch)
tree401f87361a147baf9d1c707fd3f6c60324230db7 /src/declarative/graphicsitems/qdeclarativelistview.cpp
parent79c2f9d676d782212fb17f9158604e8158c47a22 (diff)
downloadQt-168abf1f3165f0a6d83f747c46f3d3241b1a405f.zip
Qt-168abf1f3165f0a6d83f747c46f3d3241b1a405f.tar.gz
Qt-168abf1f3165f0a6d83f747c46f3d3241b1a405f.tar.bz2
doc: note that calling methods before component completion may have no effect
So use Component.onCompleted:
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativelistview.cpp')
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index 35e6bab..35794c2 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -2386,6 +2386,8 @@ void QDeclarativeListView::keyPressEvent(QKeyEvent *event)
Increments the current index. The current index will wrap
if keyNavigationWraps is true and it is currently at the end.
+
+ \bold Note: methods should only be called after the Component has completed.
*/
void QDeclarativeListView::incrementCurrentIndex()
{
@@ -2403,6 +2405,8 @@ void QDeclarativeListView::incrementCurrentIndex()
Decrements the current index. The current index will wrap
if keyNavigationWraps is true and it is currently at the beginning.
+
+ \bold Note: methods should only be called after the Component has completed.
*/
void QDeclarativeListView::decrementCurrentIndex()
{
@@ -2439,6 +2443,14 @@ void QDeclarativeListView::decrementCurrentIndex()
of the list does not cause all other items to be repositioned, and because
the actual start of the view can vary based on the size of the delegates.
The correct way to bring an item into view is with \c positionViewAtIndex.
+
+ \bold Note: methods should only be called after the Component has completed. To position
+ the view at startup, this method should be called by Component.onCompleted. For
+ example, to position the view at the end:
+
+ \code
+ Component.onCompleted: positionViewAtIndex(count - 1, ListView.Beginning)
+ \endcode
*/
void QDeclarativeListView::positionViewAtIndex(int index, int mode)
{
@@ -2509,6 +2521,8 @@ void QDeclarativeListView::positionViewAtIndex(int index, int mode)
If the item is outside the visible area, -1 is returned, regardless of
whether an item will exist at that point when scrolled into view.
+
+ \bold Note: methods should only be called after the Component has completed.
*/
int QDeclarativeListView::indexAt(int x, int y) const
{