diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2017-12-14 10:40:53 +0100 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2018-04-26 07:11:43 +0000 |
commit | 78be6b2aa4da54cb41ed60a31abfb7312fb44c9a (patch) | |
tree | b22190dbb6bcf121f359c46704da7e87bab7c176 /src/qml/jsruntime/qv4script_p.h | |
parent | 9f731b6841bbc9b7425a95303369d05be895f949 (diff) |
Fix issue where updated text in layout is not correctly rewrapped
When the text element is inside a Qt Quick layout and we set the implicit width,
this can trigger the Layout to resize the width further down in the stack. At
this point, a recursion guard we have in place to protect against binding
loops will cause us to ignore the size update. The end result is that the text
width has changed, but the contents have not been updated to reflect this.
This change detects this case by checking if the width of the text changed
while the recursion guard was in place, and if it was, we call updateSize()
again to make sure everything is up-to-date.
I added a second admittedly ugly recursion guard for this out of paranoia.
I haven't seen any case where this might cause an infinite recursion, but
it seemed better to be on the safe side.
[ChangeLog][Text] Fixed an issue where updating text inside a layout would
not cause it to correctly adapt to its new width.
Task-number: QTBUG-53279
Change-Id: I1e421a7073428fa490a24be36208a2077f5836dd
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4script_p.h')
0 files changed, 0 insertions, 0 deletions