Make lastPosition() result consistent among GridView and ListView
authorBea Lam <bea.lam@nokia.com>
Wed, 13 Jul 2011 03:46:57 +0000 (13:46 +1000)
committerQt by Nokia <qt-info@nokia.com>
Thu, 21 Jul 2011 00:35:45 +0000 (02:35 +0200)
commit0592e17e18e26acc177bc7556a3c9888582f0045
treec66df0adb57ecfbd7eab1105f139e10aed72da36
parent7141596fae74938c907209482a46ecb73df1d4f8
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>
src/declarative/items/qsggridview.cpp
src/declarative/items/qsgitemview.cpp
src/declarative/items/qsgitemview_p_p.h
src/declarative/items/qsglistview.cpp
tests/auto/declarative/qsggridview/tst_qsggridview.cpp