From 01276467bc7cf9b7cf8f83dc924a47b90e5bf053 Mon Sep 17 00:00:00 2001 From: Robert Griebl Date: Sun, 5 Dec 2010 19:53:12 +0100 Subject: Fix code style issues in QScroller based Flickable replacement. --- src/declarative/graphicsitems/qdeclarativegridview.cpp | 4 ++-- src/declarative/graphicsitems/qdeclarativelistview.cpp | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index b6af7dc..8f6c34f 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -1610,14 +1610,14 @@ bool QDeclarativeGridView::event(QEvent *event) qreal rowPos = d->rowPosAt(d->currentIndex); if (rowPos - d->rowSize() >= 0) snapPoints.append( rowPos - d->rowSize()); - else if( d->header ) + else if (d->header) snapPoints.append(0); // position of the header snapPoints.append(rowPos); if (rowPos + d->rowSize() < d->headerSize() + d->contentSize()) snapPoints.append(rowPos + d->rowSize()); - else if( d->footer ) + else if (d->footer) snapPoints.append(d->headerSize() + d->contentSize() + snapOffset); // position of the footer } diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 27f7b52..d6a75ba 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -309,7 +309,7 @@ public: pos = visibleItems.first()->position(); pos -= visibleIndex * (averageSize + spacing); } - if( header ) + if (header) pos -= header->size(); return pos; } @@ -960,7 +960,6 @@ void QDeclarativeListViewPrivate::recreateHighlight() */ void QDeclarativeListViewPrivate::updateHighlight(bool smooth) { - if ((!currentItem && highlight) || (currentItem && !highlight)) recreateHighlight(); @@ -2356,7 +2355,7 @@ void QDeclarativeListView::viewportAboutToMove(QPointF newPos) // qDebug() << "viewport about to move"; // need to refill before moving - if( d->orient == Horizontal ) + if (d->orient == Horizontal) d->refill(newPos.x(), newPos.x() + width() - 1); else d->refill(newPos.y(), newPos.y() + height() - 1); @@ -2837,7 +2836,6 @@ void QDeclarativeListView::itemsRemoved(int modelIndex, int count) } } - // restore the start position of the visible items if (firstVisible && forceConst(d->visibleItems).first() != firstVisible) forceConst(d->visibleItems).first()->setPosition(forceConst(d->visibleItems).first()->position() + preRemovedSize); -- cgit v0.12