diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-06-23 23:27:08 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-06-23 23:27:08 (GMT) |
commit | 168abf1f3165f0a6d83f747c46f3d3241b1a405f (patch) | |
tree | 401f87361a147baf9d1c707fd3f6c60324230db7 /src/declarative/graphicsitems/qdeclarativegridview.cpp | |
parent | 79c2f9d676d782212fb17f9158604e8158c47a22 (diff) | |
download | Qt-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/qdeclarativegridview.cpp')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativegridview.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index 8e53237..14980a8 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -1919,6 +1919,8 @@ void QDeclarativeGridView::keyPressEvent(QKeyEvent *event) Move the currentIndex up one item in the view. 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 QDeclarativeGridView::moveCurrentIndexUp() { @@ -1942,6 +1944,8 @@ void QDeclarativeGridView::moveCurrentIndexUp() Move the currentIndex down one item in the view. 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 QDeclarativeGridView::moveCurrentIndexDown() { @@ -1965,6 +1969,8 @@ void QDeclarativeGridView::moveCurrentIndexDown() Move the currentIndex left one item in the view. 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 QDeclarativeGridView::moveCurrentIndexLeft() { @@ -1988,6 +1994,8 @@ void QDeclarativeGridView::moveCurrentIndexLeft() Move the currentIndex right one item in the view. 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 QDeclarativeGridView::moveCurrentIndexRight() { @@ -2028,6 +2036,14 @@ void QDeclarativeGridView::moveCurrentIndexRight() at a particular index. This is unreliable since removing items from the start of the view does not cause all other items to be repositioned. 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, GridView.Beginning) + \endcode */ void QDeclarativeGridView::positionViewAtIndex(int index, int mode) { @@ -2097,6 +2113,8 @@ void QDeclarativeGridView::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 QDeclarativeGridView::indexAt(int x, int y) const { |