The QSplitter class implements a splitter widget.
A splitter lets the user control the size of child widgets by dragging the boundary between them. Any number of widgets may be controlled by a single splitter. The typical use of a QSplitter is to create several widgets and add them using insertWidget() or addWidget().
Could we use this in create() in the Frame class in qtui instead of GridLayout so that we can adjust the allocation of horizontal space between the three main panels?
- Code: Select all
self.h_layout = QtWidgets.QGridLayout()
...
self.h_layout.addWidget(self.l_panel, 0, 0)
...
self.h_layout.addLayout(self.t_layout, 0, 1)
...
self.t_layout.addWidget(self.canvas)
...
self.h_layout.addWidget(self.r_panel, 0, 2)
to
- Code: Select all
self.h_layout = QtWidgets.QSplitter()
...
self.h_layout.addWidget(self.l_panel)
self.h_layout.addWidget(self.t_layout)
self.h_layout.addWidget(self.r_panel)
With the current setup long labels sometimes get truncated because the side columns are not wide enough, e.g. if you have subdirectories in the custom folder.
I can't immediately think of any disadvantage to using QSplitter.
Pretty please!?
P.S. I have no experience with Qt so I might be wrong, but you might not need t_panel, top, and t_layout when using QSplitter, just adding the canvas directly might work.