diff options
Diffstat (limited to 'src/declarative/graphicsitems/qmlgraphicslistview.cpp')
-rw-r--r-- | src/declarative/graphicsitems/qmlgraphicslistview.cpp | 6 |
1 files 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())); } } |