aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/items/qsgitemview_p_p.h
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2011-07-13 13:46:57 +1000
committerQt by Nokia <qt-info@nokia.com>2011-07-21 02:35:45 +0200
commit0592e17e18e26acc177bc7556a3c9888582f0045 (patch)
treec66df0adb57ecfbd7eab1105f139e10aed72da36 /src/declarative/items/qsgitemview_p_p.h
parent7141596fae74938c907209482a46ecb73df1d4f8 (diff)
Make lastPosition() result consistent among GridView and ListView
lastPosition() returns the end position of the last item so it should always include a -1 calculation for the last item (as FxListItemSG::endPosition() and FxGridItemSG::endPosition() do) to get the last edge pixel of the item. With this fix, both views now calculate startPosition() and endPosition() in the same way. This also fixes positioning of GridView items in TopToBottom+RightToLeft layouts. Incorrect test values in positionViewAtIndex_rightToLeft() test are fixed (the last edge of a 1-pixel border shouldn't be visible, since the bottom edge of a 1-pixel border is actually drawn outside, not inside, the Rectangle). Change-Id: I253c3836f871c61e13c08f67007ebc75e09378d6 Reviewed-on: http://codereview.qt.nokia.com/1547 Reviewed-by: Bea Lam <bea.lam@nokia.com> Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Diffstat (limited to 'src/declarative/items/qsgitemview_p_p.h')
-rw-r--r--src/declarative/items/qsgitemview_p_p.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/declarative/items/qsgitemview_p_p.h b/src/declarative/items/qsgitemview_p_p.h
index aa1d14d5be..78f0e149f0 100644
--- a/src/declarative/items/qsgitemview_p_p.h
+++ b/src/declarative/items/qsgitemview_p_p.h
@@ -85,6 +85,8 @@ public:
bool isValid() const;
qreal position() const;
qreal size() const;
+ qreal startPosition() const;
+ qreal endPosition() const;
int findLastVisibleIndex(int defaultValue = -1) const;
FxViewItem *visibleItem(int modelIndex) const;
FxViewItem *firstVisibleItem() const;
@@ -165,11 +167,10 @@ protected:
virtual Qt::Orientation layoutOrientation() const = 0;
virtual bool isContentFlowReversed() const = 0;
- virtual qreal startPosition() const = 0;
virtual qreal positionAt(int index) const = 0;
- virtual qreal endPosition() const = 0;
virtual qreal endPositionAt(int index) const = 0;
- virtual qreal lastPosition() const = 0;
+ virtual qreal originPosition() const = 0;
+ virtual qreal lastPosition() const = 0;
virtual qreal headerSize() const = 0;
virtual qreal footerSize() const = 0;