diff options
author | Marius Bugge Monsen <mmonsen@trolltech.com> | 2009-06-10 14:43:21 +0200 |
---|---|---|
committer | Marius Bugge Monsen <mmonsen@trolltech.com> | 2009-06-10 14:43:21 +0200 |
commit | df1b73b21d1e90e1c37705b44747ee671220bc22 (patch) | |
tree | 0de95deec582076bf5acae3c24ed1daa0b2293e6 /src | |
parent | 541891f3bc60833e0c7aefa5b1f21b60cabc8495 (diff) |
Make sure QtGraphicsListView::maximumOffset() only returns positive values. Auto-test included.
Diffstat (limited to 'src')
-rw-r--r-- | src/qgraphicslistview.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qgraphicslistview.cpp b/src/qgraphicslistview.cpp index a2f1546..0de92b7 100644 --- a/src/qgraphicslistview.cpp +++ b/src/qgraphicslistview.cpp @@ -895,7 +895,7 @@ qreal QtGraphicsListView::maximumOffset() const content += size.height(); max = qMax(max, size.height()); } - return content - size().height(); + return qMax<qreal>(content - size().height(), 0); } else { // Horizontal for (int index = 0; index < count; ++index) { initStyleOption(&option, index); @@ -903,7 +903,7 @@ qreal QtGraphicsListView::maximumOffset() const content += size.width(); max = qMax(max, size.width()); } - return content - size().width(); + return qMax<qreal>(content - size().width(), 0); } } |