Make QGraphicsView respect scrollbar policies
authorJeremy Lainé <jeremy.laine@m4x.org>
Mon, 30 Jan 2012 06:42:51 +0000 (07:42 +0100)
committerQt by Nokia <qt-info@nokia.com>
Fri, 31 Aug 2012 14:29:43 +0000 (16:29 +0200)
commit28881c0c91aa53412fae32c52ab297c76e890971
tree09f0b9daed6813e44f4abd4cf0da0dc165621e96
parent99ef183cb1395bab34ec8865d1d47ffa44b94a64
Make QGraphicsView respect scrollbar policies

When calculating the maximum height / width which a QGraphicsView can display,
make sure we only take the scrollbars' dimensions into account if their policy
is set to Qt::ScrollBarAsNeeded:

- if the policy is set to Qt::ScrollBarAlwaysOff, the scrollbar will not be
  displayed at all

- if the policy is set to Qt::ScrollBarAlwaysOn, the scrollbar's dimensions
have already been substracted from the available space by
QAbstractScrollArea::maximumViewportSize()

Task-number: QTBUG-14711
Change-Id: If5d24b41dbe7b089abca2bf61ccbd370d4de79a1
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
src/widgets/graphicsview/qgraphicsview.cpp
tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview_2.cpp