diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-08-31 02:38:12 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-08-31 02:38:12 (GMT) |
commit | cfc3564328c9545a9eed4aca02f99dac5e0e4390 (patch) | |
tree | 93e8337a555e343b281b62994b6848b4e564fbb4 /src | |
parent | d01313b94e1eb8f8b9aa088433118459b588a79f (diff) | |
download | Qt-cfc3564328c9545a9eed4aca02f99dac5e0e4390.zip Qt-cfc3564328c9545a9eed4aca02f99dac5e0e4390.tar.gz Qt-cfc3564328c9545a9eed4aca02f99dac5e0e4390.tar.bz2 |
Ensure Flickable visibleArea is updated when view height changes
Task-number: QTBUG-13095
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativeflickable.cpp | 4 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativelistview.cpp | 10 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativelistview_p.h | 1 |
3 files changed, 15 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp index a710190..63a2a77 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp @@ -1001,12 +1001,16 @@ void QDeclarativeFlickable::geometryChanged(const QRectF &newGeometry, bool changed = false; if (newGeometry.width() != oldGeometry.width()) { + if (xflick()) + changed = true; if (d->hData.viewSize < 0) { d->contentItem->setWidth(width()); emit contentWidthChanged(); } } if (newGeometry.height() != oldGeometry.height()) { + if (yflick()) + changed = true; if (d->vData.viewSize < 0) { d->contentItem->setHeight(height()); emit contentHeightChanged(); diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index d3d46f7..ef28ab2 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -2454,6 +2454,16 @@ void QDeclarativeListView::keyPressEvent(QKeyEvent *event) QDeclarativeFlickable::keyPressEvent(event); } +void QDeclarativeListView::geometryChanged(const QRectF &newGeometry, + const QRectF &oldGeometry) +{ + Q_D(QDeclarativeListView); + d->maxExtentDirty = true; + d->minExtentDirty = true; + QDeclarativeFlickable::geometryChanged(newGeometry, oldGeometry); +} + + /*! \qmlmethod ListView::incrementCurrentIndex() diff --git a/src/declarative/graphicsitems/qdeclarativelistview_p.h b/src/declarative/graphicsitems/qdeclarativelistview_p.h index 8fbff49..735b248 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview_p.h +++ b/src/declarative/graphicsitems/qdeclarativelistview_p.h @@ -246,6 +246,7 @@ protected: virtual qreal minXExtent() const; virtual qreal maxXExtent() const; virtual void keyPressEvent(QKeyEvent *); + virtual void geometryChanged(const QRectF &newGeometry,const QRectF &oldGeometry); virtual void componentComplete(); private Q_SLOTS: |