Dynamic grid layout with splitters
-
@Joel-Bodenmann
if i got you correctly QMainWindow with QDockWidgets is really close to what you want to achieve -
@raven-worx Not at all. the
QMainWindow
only allows me to put but one "row" of widgets around the central widgets. My goal is to have a widget that arranges any number of widgets in any pattern as shown in my diagram, not just one row around a central widget.Also I want that to become the central widget of my main window. I am already using the dock widgets for other stuff ;)
-
@Joel-Bodenmann
ok.
I am afraid there is no (standard) ready Qt-provided solution for you.
Either you look for a 3rd party implementation or do it yourself. But i guess that it will be a lot of work. -
Thank you for your help, I appreciate it.
This will indeed result in a few nights worth of coding :P -
Hello @Joel-Bodenmann ,
I am interested in your idea, did you ahieve what you wanted.?
If so, did you use QSplitters.? -
@qtProgrammer Please excuse the late reply...
Yes I managed to get something up and running. It's a basic tiling window manager that uses
QSplitter
. What I have so far is working. You can put anyQWidget
at any place and resize the tiles with the mouse. However, drag'n'drop is not even close to finished.
As it's far from finished and not really well tested I decided not to share it. It's currently collecting dust sitting on my SSD. -
Hi
Even if not finished, it would still be super sample of how to use splitters in a clever way :) -
I'd be interested in that example as well,
I heard people saying that Splitter is not an alternate to layout but just a container. But a layout is nothing but a container with some nice control over how widgets are laid out. Why not splitter have the same advantage.? After trying to find more info on QSplitter, i can say that there's not much available except the surface level documenation. -
@Joel-Bodenmann Hi Joel, however unlikely as it may be, do you still have access to any of this code? Very curious how you implemented splitters inside the QGridLayout. If I understand correctly, you were able to drag widgets in order to expand/de-expand them using the QSplitters?
-
@russQt Well, this has been a long time ago... :D
I definitely had this working - I used it with at least some success back then.
Unfortunately, I did throw this code/project out last year when performing some housekeeping (getting rid of old stuff).I might still have it around on an old laptop. I'll check in the next few days and report back. But please don't keep your hopes up. Chances are slim.
-
@russQt I was digging hard but unfortunately I have no positive news for you. Sorry about that.
-