When restoring a layout it can happen that the widget has
different size constraints when being restored, so this warning
was benign. There's a chekcSanity() later, so that's what's matters
The layouting was becoming too complex to maintain and to introduce
new features. Was even buggy, the fuzzer was constantly finding
bugs, which took hours to workaround.
Problem with the old layout engine is that there was a catch 22, between
Items driving the separators, and separators driving the anchors.
The new layout is much simpler, both in implementation and conceptually.
There's simply a recursive hierarchy of Item elements. An Item can either
have a QWidget to show, or be a ItemContainer, which contains Item children,
and so forth. Each ItemContainer is either vertical or horizontal. That's enough
to represent the "nested multi-splitter" concept which KDDW uses.
After each item insertion/deletion/resize, the separators are regenerated. They
are essentially dumb now.
TODO:
- Separators are drawn, but are not interactive yet
- There's 5 tests failing
- LayoutSaver scalling functionality
And renamed it to 17.json, as we already have an unrelated 2.json.
The removed check isn't needed, as we'll check again when we
finish restoring the placeholder. It was also a false-positive
warning sometimes because boundPositionForAnchor() would fail
since the "anchors following" wasnt initialized yet, as we do
a clearAnchorsFollowing while restoring the placeholder
It doesn't make sense to only grow one side, as sometimes the item
must grow in both sizes, as the right side might now have enough
to acomodate its needs.
This also allows us to not use Anchor::ensureBounded(), as separators
being within their bounds doesn't imply min sizes being respected, while
the inverse is true
fuzzer testcase 10.json now passes
When adjusting the vertical separators we should only check if
the group has enough width. It's height is adjusted in ensureAnchorsBounded().
(And vice-versa)
Found via fuzzer's test-case 9.json. Passes now.
Gives:
MultiSplitterLayout::checkSanity: Widget KDDockWidgets::Item(0x55e8038d8f90)
with rect QRect(0,0 1953x407) Intersects anchor KDDockWidgets::Anchor(0x55e803a17ba0)
with rect QRect(1209,406 5x562)