Skip to content
Commit 04b0ccab authored by Arjen Hiemstra's avatar Arjen Hiemstra
Browse files

toolbarlayout: Buffer calls to calculateImplicitSize()

`calculateImplicitSize()` is called by ToolBarLayoutDelegate to update
the implicit size after the delegate knows what its actual size is.
However, since it needs the delegates to determine the size, it will
call `createDelegates()` to update the list of delegates. This works
fine if the delegate is properly async, unfortunately in some cases Qt
will force the delegate creation into sync mode as there is no async
incubation controller. This then creates an infinite recursion as
ToolBarLayout does not yet know that the delegate exists and tries to
create a new one.

To avoid that, we can change implicit size calculation to be a part of
the layout process, only recalculating it when actually needed. Any
explicit calls to recalculate the implicit size will instead invalidate
the implicit size and call `polish()`. This makes relayouting calls
avoid the loop while ensuring layouting has the most up to date
information about delegate sizes.

BUG: 471286
parent 7692b64d
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment