I’m working on a project that needs lots of toolbars on screen at once, even though not all of them will be used at the same time. So, I’m modelling this ‘foldable’ dock widget after what I remember Photoshop panels used to be like.
It’s a work in progress, but would like to hear constructive suggestions.
https://blocks.programming.dev/0101100101/42c5d67f86c049baa3500aa38e439f8a
Nice.
Depending upon what you are aiming for, I’d go with a sidebar. Something like this:
This is in contrast to usual sidebars that tend to have a main tab bar, which only allows for a single docked widget to be shown at a time. This will allow the user to stack widgets both vertically and horizontally as per their requirements. A similar example can be seen in the right side panel in the Design Mode of Qt Creator itself.
Folded widgets/sections, when docked, will yield vertical space to other widgets/sections, which will in turn, snap upwards (or you can do downwards if that’s your fancy)
Maybe you can also make the floating widgets mergeable into tabs, which will reduce the number of point+click actions in cases where only 1 of 2 widgets is being used.
CC BY-NC-SA 4.0
Qt automatically handles the conversion of QDockWidgets into tabbed docked widgets when one is dragged over an existing one.
I have a little demo video, but I have no idea where to upload it to!
Oh! You actually used
QDockWidget
instead of making it from the start. I should have read the code before commenting, I guess.