From: Bea Lam Date: Mon, 5 Sep 2011 01:40:10 +0000 (+1000) Subject: View refill operations should take qreal, not int X-Git-Tag: qt-v5.0.0-alpha1~1739 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c0fe60cad2c48f18e618c3ca4589abe73752389e;p=profile%2Fivi%2Fqtdeclarative.git View refill operations should take qreal, not int Regression from initial creation of QSGItemView. Task-number: QTBUG-21281 Change-Id: I810a0b56ba4bacda49ac62b6e4c11cf9c1825c10 Reviewed-on: http://codereview.qt.nokia.com/4160 Reviewed-by: Bea Lam Reviewed-by: Qt Sanity Bot --- diff --git a/src/declarative/items/qsggridview.cpp b/src/declarative/items/qsggridview.cpp index 1d4e831..e2fe5cd 100644 --- a/src/declarative/items/qsggridview.cpp +++ b/src/declarative/items/qsggridview.cpp @@ -160,8 +160,8 @@ public: FxViewItem *snapItemAt(qreal pos) const; int snapIndex() const; - virtual bool addVisibleItems(int fillFrom, int fillTo, bool doBuffer); - virtual bool removeNonVisibleItems(int bufferFrom, int bufferTo); + virtual bool addVisibleItems(qreal fillFrom, qreal fillTo, bool doBuffer); + virtual bool removeNonVisibleItems(qreal bufferFrom, qreal bufferTo); virtual void visibleItemsChanged(); virtual FxViewItem *newViewItem(int index, QSGItem *item); @@ -387,7 +387,7 @@ FxViewItem *QSGGridViewPrivate::newViewItem(int modelIndex, QSGItem *item) return new FxGridItemSG(item, q, false); } -bool QSGGridViewPrivate::addVisibleItems(int fillFrom, int fillTo, bool doBuffer) +bool QSGGridViewPrivate::addVisibleItems(qreal fillFrom, qreal fillTo, bool doBuffer) { int colPos = colPosAt(visibleIndex); int rowPos = rowPosAt(visibleIndex); @@ -479,7 +479,7 @@ bool QSGGridViewPrivate::addVisibleItems(int fillFrom, int fillTo, bool doBuffer return changed; } -bool QSGGridViewPrivate::removeNonVisibleItems(int bufferFrom, int bufferTo) +bool QSGGridViewPrivate::removeNonVisibleItems(qreal bufferFrom, qreal bufferTo) { FxGridItemSG *item = 0; bool changed = false; diff --git a/src/declarative/items/qsgitemview_p_p.h b/src/declarative/items/qsgitemview_p_p.h index 2430455..2164dd6 100644 --- a/src/declarative/items/qsgitemview_p_p.h +++ b/src/declarative/items/qsgitemview_p_p.h @@ -217,8 +217,8 @@ protected: virtual void setPosition(qreal pos) = 0; virtual void fixupPosition() = 0; - virtual bool addVisibleItems(int fillFrom, int fillTo, bool doBuffer) = 0; - virtual bool removeNonVisibleItems(int bufferFrom, int bufferTo) = 0; + virtual bool addVisibleItems(qreal fillFrom, qreal fillTo, bool doBuffer) = 0; + virtual bool removeNonVisibleItems(qreal bufferFrom, qreal bufferTo) = 0; virtual void visibleItemsChanged() = 0; virtual FxViewItem *newViewItem(int index, QSGItem *item) = 0; diff --git a/src/declarative/items/qsglistview.cpp b/src/declarative/items/qsglistview.cpp index 321c66c..e8a6bf2 100644 --- a/src/declarative/items/qsglistview.cpp +++ b/src/declarative/items/qsglistview.cpp @@ -201,8 +201,8 @@ public: virtual void init(); virtual void clear(); - virtual bool addVisibleItems(int fillFrom, int fillTo, bool doBuffer); - virtual bool removeNonVisibleItems(int bufferFrom, int bufferTo); + virtual bool addVisibleItems(qreal fillFrom, qreal fillTo, bool doBuffer); + virtual bool removeNonVisibleItems(qreal bufferFrom, qreal bufferTo); virtual void visibleItemsChanged(); virtual FxViewItem *newViewItem(int index, QSGItem *item); @@ -539,7 +539,7 @@ void QSGListViewPrivate::releaseItem(FxViewItem *item) QSGItemViewPrivate::releaseItem(item); } -bool QSGListViewPrivate::addVisibleItems(int fillFrom, int fillTo, bool doBuffer) +bool QSGListViewPrivate::addVisibleItems(qreal fillFrom, qreal fillTo, bool doBuffer) { qreal itemEnd = visiblePos; if (visibleItems.count()) { @@ -603,7 +603,7 @@ bool QSGListViewPrivate::addVisibleItems(int fillFrom, int fillTo, bool doBuffer return changed; } -bool QSGListViewPrivate::removeNonVisibleItems(int bufferFrom, int bufferTo) +bool QSGListViewPrivate::removeNonVisibleItems(qreal bufferFrom, qreal bufferTo) { FxViewItem *item = 0; bool changed = false;