qt5base-lts/tests/auto/widgets
Volker Hilsheimer 6c4dc722cb Reduce the width of a hfw-widget if scrollbar would be flipping
For a widget that implements height-for-width, the vertical scrollbar
becoming visible might be just enough to make the scrollbar unnecessary.
In that situation, the scrollbar flips on and off continuously.

To avoid that situation, make the width of the widget smaller until the
height fits without scrollbar, up to the point where we have space for
the scrollbar anyway.

The calcuation here is assumed to be cheap, but depends on the
heightForWidth implementation in the widget. Running the while-loop a
few dozen times should have no performance impact during resizing
and laying out the scroll area contents.

Add a test that confirms that within a brief period of time we only get
the one hide-event we expect.

Done-with: Zou Ya <zouya@uniontech.com>
Fixes: QTBUG-92958
Pick-to: 6.2 5.15
Change-Id: I0faeb5f9b1a226aada958c18333d9c2ac8203dd1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-10-11 10:49:57 +02:00
..
dialogs Don't clear focus if setParent doesn't change the parent 2021-09-28 17:42:57 +02:00
effects Fix tst_qgraphicseffect on Wayland 2021-03-11 08:04:21 +01:00
graphicsview Remove conditioning on Android embedded 2021-09-17 17:30:14 +02:00
itemviews QAbstractItemView: Fix IM input starting edit session 2021-10-01 01:48:50 +02:00
kernel QCocoaWindow: Make window key if the app's modal window is hidden 2021-10-07 14:30:53 +00:00
styles Implement missing support for 'em' and 'ex' lengths in style sheet 2021-08-10 19:43:02 +02:00
util Fix auto completion in QFileDialog on Windows 2021-07-09 00:48:44 +02:00
widgets Reduce the width of a hfw-widget if scrollbar would be flipping 2021-10-11 10:49:57 +02:00
CMakeLists.txt Begin port of qtbase to CMake 2018-11-01 11:48:46 +00:00