summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-03-04 04:39:18 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-03-04 04:39:18 (GMT)
commit8047d8f2e63df60b5ea3f6fd02568658c3d19fc6 (patch)
treee80be1efca84cb803294b2a790600febb84d1c6b /src
parentdb2935035697e0abdb156b895ee82b3907014e78 (diff)
downloadQt-8047d8f2e63df60b5ea3f6fd02568658c3d19fc6.zip
Qt-8047d8f2e63df60b5ea3f6fd02568658c3d19fc6.tar.gz
Qt-8047d8f2e63df60b5ea3f6fd02568658c3d19fc6.tar.bz2
Documented view behavior when items are removed from start of view.
Task-number: QTBUG-7694
Diffstat (limited to 'src')
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview.cpp12
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp6
2 files changed, 18 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
index b3c5577..463b238 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -1340,6 +1340,18 @@ void QDeclarativeGridView::moveCurrentIndexRight()
}
}
+/*!
+ \qmlmethod GridView::positionViewAtIndex(int index)
+
+ Positions the view such that the \a index is at the top (or left for horizontal orientation) of the view.
+ If positioning the view at the index would cause empty space to be displayed at
+ the end of the view, the view will be positioned at the end.
+
+ It is not recommended to use contentX or contentY to position the view
+ at a particular index. This is unreliable since removing items from the start
+ of the list does not cause all other items to be repositioned.
+ The correct way to bring an item into view is with positionViewAtIndex.
+*/
void QDeclarativeGridView::positionViewAtIndex(int index)
{
Q_D(QDeclarativeGridView);
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index a5da424..32627da 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -2286,6 +2286,12 @@ void QDeclarativeListView::decrementCurrentIndex()
Positions the view such that the \a index is at the top (or left for horizontal orientation) of the view.
If positioning the view at the index would cause empty space to be displayed at
the end of the view, the view will be positioned at the end.
+
+ It is not recommended to use contentX or contentY to position the view
+ at a particular index. This is unreliable since removing items from the start
+ 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 positionViewAtIndex.
*/
void QDeclarativeListView::positionViewAtIndex(int index)
{