summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp
diff options
context:
space:
mode:
authorVitaly Fanaskov <vitaly.fanaskov@qt.io>2018-11-22 14:39:51 +0100
committerVitaly Fanaskov <vitaly.fanaskov@qt.io>2018-11-26 16:03:33 +0000
commitba13c6c08f30a4c2f188f69deeaf4ca6a020d7a1 (patch)
tree9514aa7670bf143de6d258a429a5d02d494dee0d /tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp
parent70d131af33c8b411f430d0699b4294b5976db8e3 (diff)
Fix calculation of text margin if line edit contains side widgets
The previous implementation leads to infinite chain of showing/hidden line edit under circumstances described in QTBUG-54676. We basically got the situation when size hint were calculated differently depending on the line edit visibility state. In this case toolbar layout have to show/hide extension button and line edit a lot of times and can never leave this "loop" (please note, that the chain is much more complicated in reality): Resize toolbar -> Set layout geometry -> Size is OK to display line edit -> Set layout geometry -> Hide extension button -> Set layout geometry (wrong size is calculated here, so "run out of space") -> Hide line edit -> Set layout geometry -> Show extension button -> Set layout geometry - > Size is OK to display line edit ... And we're in the "loop" Clear button is hidden if there is no text in a line edit. In the previous implementation, the button was always visible, only opacity was changing in order to "hide" the button. It resulted to incorrect size hints (regular and minimum). In the current implementation the button is really hidden/shown, and size hints calculated correctly. Also updated unit test for line edit. Remove code duplication in functions for calculation text margin Fixes: QTBUG-54676 Change-Id: I4549c9ea98e10b750ba855a07037f6392276358b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp')
0 files changed, 0 insertions, 0 deletions