From 16684c81e962776b6eb078219e43fd6ec0aa2dbb Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 8 Feb 2010 17:27:54 +1000 Subject: Fix viewport size update. --- src/declarative/graphicsitems/qmlgraphicslistview.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/declarative/graphicsitems/qmlgraphicslistview.cpp b/src/declarative/graphicsitems/qmlgraphicslistview.cpp index 26be7d8..a7a37e5 100644 --- a/src/declarative/graphicsitems/qmlgraphicslistview.cpp +++ b/src/declarative/graphicsitems/qmlgraphicslistview.cpp @@ -448,9 +448,11 @@ public: void updateViewport() { Q_Q(QmlGraphicsListView); if (orient == QmlGraphicsListView::Vertical) { - q->setViewportHeight(q->minYExtent() - q->maxYExtent()); + qreal vpHeight = -q->maxYExtent() + q->minYExtent() + q->height(); + q->setViewportHeight(vpHeight); } else { - q->setViewportWidth(q->minXExtent() - q->maxXExtent()); + qreal vpWidth = -q->maxXExtent() + q->minXExtent() + q->width(); + q->setViewportWidth(qMin(vpWidth, q->width())); } } -- cgit v0.12