Our example was being built as part of KDDW, so that worked fine.
Now it can also be built with an installed KDDW.
Problem was the folder hiearchy in the installed include dir
didn't match the folder hiearchy in the source repo
Fixes#62
Cherry-picked from master's 037fa76fff
1.0 makes more sense
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
As happens with other docking frameworks:
- Maximized/restore button only visible when window is floating
- floating button is never visible
Available by setting Flag_TitleBarHasMaximizeButton.
Added example too.
Fixes: #37
Same for restore.
This is better API as LayoutSaver shouldn't be concerned about
QSettings. It also assumed the user only had a single layout, which
is normally not the case.
And finally, storing escaped json in .ini files is not very elegant.
Can be tested with kddockwidgets_example -c
Disabled by default, as I'm not 100% happy with it:
A dock widget with the "non closable" attribute will still show
the x button on the tab bar. Clicking on it won't do anything but
doesn't look so nice. Qt doesn't allow to have the close buttons only
in some tabs.
Fixes#26
By default a dock widget can dock into any main window.
With affinities, we can now have a dock widget "belong" to a main window
and only be able to dock into it (or into other floating dock widgets
with the same affinity).
See DockWidgetBase::setAffinity() and MainWindowBase::setAffinity().