--- a/src/hbwidgets/itemviews/hbgridview.cpp Thu Sep 02 20:44:51 2010 +0300
+++ b/src/hbwidgets/itemviews/hbgridview.cpp Fri Sep 17 08:32:10 2010 +0300
@@ -120,11 +120,13 @@
{
Q_D(HbGridView);
- d->mVisibleIndex = d->firstFullyVisibleIndex();
+ if (d->itemContainer()->rowCount() != rowCount) {
+ d->mVisibleIndex = d->firstFullyVisibleIndex();
- d->itemContainer()->setRowCount(rowCount);
+ d->itemContainer()->setRowCount(rowCount);
- scrollTo(d->mVisibleIndex, HbAbstractItemView::PositionAtTop);
+ scrollTo(d->mVisibleIndex, HbAbstractItemView::PositionAtTop);
+ }
}
/*!
@@ -147,11 +149,13 @@
{
Q_D(HbGridView);
- d->mVisibleIndex = d->firstFullyVisibleIndex();
+ if (d->itemContainer()->columnCount() != columnCount) {
+ d->mVisibleIndex = d->firstFullyVisibleIndex();
- d->itemContainer()->setColumnCount(columnCount);
+ d->itemContainer()->setColumnCount(columnCount);
- scrollTo(d->mVisibleIndex, HbAbstractItemView::PositionAtTop);
+ scrollTo(d->mVisibleIndex, HbAbstractItemView::PositionAtTop);
+ }
}
@@ -252,12 +256,13 @@
void HbGridView::scrollTo(const QModelIndex &index, ScrollHint hint)
{
Q_D(HbGridView);
- // always use container, event if recycling is off and all items are
- // in container, but still additional action is needed -
+
+ // always use HbGridItemContainer::scrollTo, even if recycling
+ // is off - still additional action is needed -
// container::scrollTo is responsible for procesing all
// posponed events (DelayedLayoutRequest)
- if ( d->mModelIterator->model()
- && index.model() == d->mModelIterator->model()) {
+ if ( d->mModelIterator->model()
+ && index.model() == d->mModelIterator->model()) {
d->itemContainer()->scrollTo(index, hint);
HbAbstractItemView::scrollTo(index, hint);
}
@@ -304,8 +309,7 @@
}
}
- // abstract part is enough - container update buffer
- HbAbstractItemView::scrollTo(d->mVisibleIndex, HbAbstractItemView::PositionAtTop);
+ scrollTo(d->mVisibleIndex, HbAbstractItemView::PositionAtTop);
d->mVisibleIndex = QModelIndex();
}