diff options
author | Martin Jones <martin.jones@nokia.com> | 2009-09-14 23:55:30 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2009-09-14 23:55:30 (GMT) |
commit | df394cd24e65dcfa929074b794878081a42659c7 (patch) | |
tree | 4bf8075e43cd7bcb71e6b5e47fb4289c577ac799 | |
parent | fb8d3d1b325ecbe947f0cc8001f92d01a849f323 (diff) | |
download | Qt-df394cd24e65dcfa929074b794878081a42659c7.zip Qt-df394cd24e65dcfa929074b794878081a42659c7.tar.gz Qt-df394cd24e65dcfa929074b794878081a42659c7.tar.bz2 |
GridView API changes
GridView: wrap -> keyNavigationWraps
GridView: autoHighlight -> highlightFollowsCurrentItem
-rw-r--r-- | src/declarative/QmlChanges.txt | 2 | ||||
-rw-r--r-- | src/declarative/fx/qfxgridview.cpp | 20 | ||||
-rw-r--r-- | src/declarative/fx/qfxgridview.h | 8 |
3 files changed, 16 insertions, 14 deletions
diff --git a/src/declarative/QmlChanges.txt b/src/declarative/QmlChanges.txt index 25af3b1..7661e03 100644 --- a/src/declarative/QmlChanges.txt +++ b/src/declarative/QmlChanges.txt @@ -68,6 +68,8 @@ ListView: current -> currentItem GridView: current -> currentItem ListView: wrap -> keyNavigationWraps ListView: autoHighlight -> highlightFollowsCurrentItem +GridView: wrap -> keyNavigationWraps +GridView: autoHighlight -> highlightFollowsCurrentItem Additions: MouseRegion: add "acceptedButtons" property diff --git a/src/declarative/fx/qfxgridview.cpp b/src/declarative/fx/qfxgridview.cpp index d4cf691..1095dc1 100644 --- a/src/declarative/fx/qfxgridview.cpp +++ b/src/declarative/fx/qfxgridview.cpp @@ -846,12 +846,12 @@ int QFxGridView::count() const An instance of the highlight component will be created for each view. The geometry of the resultant component instance will be managed by the view - so as to stay with the current item, unless the autoHighlight property is false. + so as to stay with the current item, unless the highlightFollowsCurrentItem property is false. The below example demonstrates how to make a simple highlight: \snippet doc/src/snippets/declarative/gridview/gridview.qml 1 - \sa autoHighlight + \sa highlightFollowsCurrentItem */ QmlComponent *QFxGridView::highlight() const { @@ -868,11 +868,11 @@ void QFxGridView::setHighlight(QmlComponent *highlight) } /*! - \qmlproperty component GridView::autoHighlight + \qmlproperty bool GridView::highlightFollowsCurrentItem This property sets whether the highlight is managed by the view. - If autoHighlight is true, the highlight will be moved smoothly - to follow the current item. If autoHighlight is false, the + If highlightFollowsCurrentItem is true, the highlight will be moved smoothly + to follow the current item. If highlightFollowsCurrentItem is false, the highlight will not be moved by the view, and must be implemented by the highlight component, for example: @@ -881,19 +881,19 @@ void QFxGridView::setHighlight(QmlComponent *highlight) id: Highlight Rectangle { id: Wrapper; color: "lightsteelblue"; radius: 4; width: 320; height: 60 > - y: Follow { source: Wrapper.GridView.view.current.y; spring: 3; damping: 0.2 } - x: Follow { source: Wrapper.GridView.view.current.x; spring: 3; damping: 0.2 } + y: SpringFollow { source: Wrapper.GridView.view.currentItem.y; spring: 3; damping: 0.2 } + x: SpringFollow { source: Wrapper.GridView.view.currentItem.x; spring: 3; damping: 0.2 } } } \endcode */ -bool QFxGridView::autoHighlight() const +bool QFxGridView::highlightFollowsCurrentItem() const { Q_D(const QFxGridView); return d->autoHighlight; } -void QFxGridView::setAutoHighlight(bool autoHighlight) +void QFxGridView::setHighlightFollowsCurrentItem(bool autoHighlight) { Q_D(QFxGridView); d->autoHighlight = autoHighlight; @@ -936,7 +936,7 @@ void QFxGridView::setFlow(Flow flow) } /*! - \qmlproperty bool GridView::wrap + \qmlproperty bool GridView::keyNavigationWraps This property holds whether the grid wraps key navigation If this property is true then key presses to move off of one end of the grid will cause the diff --git a/src/declarative/fx/qfxgridview.h b/src/declarative/fx/qfxgridview.h index e08ba9e..240ed08 100644 --- a/src/declarative/fx/qfxgridview.h +++ b/src/declarative/fx/qfxgridview.h @@ -63,9 +63,9 @@ class Q_DECLARATIVE_EXPORT QFxGridView : public QFxFlickable Q_PROPERTY(QFxItem *currentItem READ currentItem NOTIFY currentIndexChanged) Q_PROPERTY(int count READ count NOTIFY countChanged) Q_PROPERTY(QmlComponent *highlight READ highlight WRITE setHighlight) - Q_PROPERTY(bool autoHighlight READ autoHighlight WRITE setAutoHighlight) + Q_PROPERTY(bool highlightFollowsCurrentItem READ highlightFollowsCurrentItem WRITE setHighlightFollowsCurrentItem) Q_PROPERTY(Flow flow READ flow WRITE setFlow) - Q_PROPERTY(bool wrap READ isWrapEnabled WRITE setWrapEnabled) + Q_PROPERTY(bool keyNavigationWraps READ isWrapEnabled WRITE setWrapEnabled) Q_PROPERTY(int cacheBuffer READ cacheBuffer WRITE setCacheBuffer) Q_PROPERTY(int cellWidth READ cellWidth WRITE setCellWidth NOTIFY cellSizeChanged) //### columnCount, rowCount Q_PROPERTY(int cellHeight READ cellHeight WRITE setCellHeight NOTIFY cellSizeChanged) @@ -90,8 +90,8 @@ public: QmlComponent *highlight() const; void setHighlight(QmlComponent *highlight); - bool autoHighlight() const; - void setAutoHighlight(bool); + bool highlightFollowsCurrentItem() const; + void setHighlightFollowsCurrentItem(bool); Q_ENUMS(Flow) enum Flow { LeftToRight, TopToBottom }; |