PDA

View Full Version : QGridLayout with QSplitter-like functionality



Rayven
6th April 2011, 20:09
Background:
I have a custom QGLWidget (plotting library) that I am currently displaying multiple plots in a QGridLayout with success. I have set the sizePolicy of the QGLWidget plot to QSizePolicy::Ignored, QSizePolicy::Ignored since I want the widget to be as large as possible.

Question 1:
I have re-implemented the layout using nested QSplitters, however when I add a second plot to the splitter, the second plot remains "squished" or much smaller than the first. setStretchFactor in QSplitter handles this by using the sizeHint of the widget, which in this case is being ignored. I would like to mimic the functionality of setRow/ColumnStretchFactor to force the widgets to share the screen equally.

Question 2:
Since QGridLayout handles the stretch really way, is it possible to add the QSplitter moving functionality to QGridLayout?