aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/items/qsggridview.cpp
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2011-08-05 15:48:16 +1000
committerQt by Nokia <qt-info@nokia.com>2011-08-05 09:23:48 +0200
commit5a8de45440ad924e5e787e12e2396ffeed6cce80 (patch)
tree55fa4e649d2a392238d5d415e0b1ca6a923186cf /src/declarative/items/qsggridview.cpp
parentab4cac7453c5da79f356bdac4b15d876dde97938 (diff)
Show header/footer if current index is set to first/last item or row
Task-number: QTBUG-17853 Change-Id: I1d679cee31d6ee2a4bb2f2bf90f73eb12898189b Reviewed-on: http://codereview.qt.nokia.com/2664 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src/declarative/items/qsggridview.cpp')
-rw-r--r--src/declarative/items/qsggridview.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/declarative/items/qsggridview.cpp b/src/declarative/items/qsggridview.cpp
index ac86ebbb7f..c9e02a0601 100644
--- a/src/declarative/items/qsggridview.cpp
+++ b/src/declarative/items/qsggridview.cpp
@@ -176,6 +176,8 @@ public:
virtual qreal headerSize() const;
virtual qreal footerSize() const;
+ virtual bool showHeaderForIndex(int index) const;
+ virtual bool showFooterForIndex(int index) const;
virtual void updateHeader();
virtual void updateFooter();
@@ -638,6 +640,16 @@ qreal QSGGridViewPrivate::footerSize() const
return flow == QSGGridView::LeftToRight? footer->item->height() : footer->item->width();
}
+bool QSGGridViewPrivate::showHeaderForIndex(int index) const
+{
+ return index / columns == 0;
+}
+
+bool QSGGridViewPrivate::showFooterForIndex(int index) const
+{
+ return index / columns == (model->count()-1) / columns;
+}
+
void QSGGridViewPrivate::updateFooter()
{
Q_Q(QSGGridView);