diff options
author | Martin Jones <martin.jones@nokia.com> | 2009-07-30 01:57:03 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2009-07-30 01:57:03 (GMT) |
commit | 926f4dec5d8b55308799e016cb99a1e481a49f3c (patch) | |
tree | 7cbaf3575a74cc4eaa59f9fa88abbf3d89c6f786 /src | |
parent | 1779358f9c91119acf81278cddc275870861d600 (diff) | |
download | Qt-926f4dec5d8b55308799e016cb99a1e481a49f3c.zip Qt-926f4dec5d8b55308799e016cb99a1e481a49f3c.tar.gz Qt-926f4dec5d8b55308799e016cb99a1e481a49f3c.tar.bz2 |
maxYExtent() should never be greater than minYExtent()
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/fx/qfxlistview.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/declarative/fx/qfxlistview.cpp b/src/declarative/fx/qfxlistview.cpp index 62b2cf8..3d97dfa 100644 --- a/src/declarative/fx/qfxlistview.cpp +++ b/src/declarative/fx/qfxlistview.cpp @@ -548,7 +548,6 @@ void QFxListViewPrivate::layout() if (!isValid()) return; q->refill(); - q->trackedPositionChanged(); updateHighlight(); if (orient == Qt::Vertical) { fixupY(); @@ -588,6 +587,8 @@ void QFxListViewPrivate::updateTrackedItem() if (highlight) item = highlight; + FxListItem *oldTracked = trackedItem; + const char *notifier1 = orient == Qt::Vertical ? SIGNAL(yChanged()) : SIGNAL(xChanged()); const char *notifier2 = orient == Qt::Vertical ? SIGNAL(heightChanged()) : SIGNAL(widthChanged()); @@ -601,9 +602,8 @@ void QFxListViewPrivate::updateTrackedItem() trackedItem = item; QObject::connect(trackedItem->item, notifier1, q, SLOT(trackedPositionChanged())); QObject::connect(trackedItem->item, notifier2, q, SLOT(trackedPositionChanged())); - q->trackedPositionChanged(); } - if (trackedItem) + if (trackedItem && trackedItem != oldTracked) q->trackedPositionChanged(); } @@ -1274,8 +1274,9 @@ qreal QFxListView::maxYExtent() const extent = -(d->positionAt(count()-1) - d->snapPos); else extent = -(d->endPosition() - height()); - if (extent > 0) - extent = 0; + qreal minY = minYExtent(); + if (extent > minY) + extent = minY; return extent; } @@ -1307,8 +1308,9 @@ qreal QFxListView::maxXExtent() const extent = -(d->positionAt(count()-1) - d->snapPos); else extent = -(d->endPosition() - width()); - if (extent > 0) - extent = 0; + qreal minX = minXExtent(); + if (extent > minX) + extent = minX; return extent; } |