Correctly update flickable visibleArea.heightRatio when geometry changes
authorNils Jeisecke <jeisecke@saltation.de>
Tue, 30 Jul 2013 11:59:01 +0000 (13:59 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 31 Jul 2013 11:26:21 +0000 (13:26 +0200)
commit1a90b94afabc064048a88b4a5fc6cd886694c061
tree230d6e139adafce5f2033d36f6d93ca7122f0c78
parent53371a557f791edc2d64c7b21cc1a5bab09afe90
Correctly update flickable visibleArea.heightRatio when geometry changes

Without this fix the visibleArea.heightRatio and widthRatio values
were only updated on geometry changes when flicking was active.

So when setting the flickable geometry to the content geometry and
thereby disabling flicking the ratios were not updated.

This could for example cause wrong scrollbar renderings.

The ratios are now also calculated directly after accessing the
visibleArea property for the first time.

The new autotest covers both problems.

Change-Id: I54ba606524557fb328a198c312c1f65eb125c5a3
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
src/quick/items/qquickflickable.cpp
tests/auto/quick/qquickflickable/data/ratios.qml [new file with mode: 0644]
tests/auto/quick/qquickflickable/tst_qquickflickable.cpp