View Full Version : How to get splitter objects to fill the screen when maximized

23rd February 2011, 18:09
I was wondering how you can get an application to fill out the main window area when resizing/maximizing? I currently have a tab that contains a QTreeView and a QDialog object. These objects are arranged by a horizontal splitter which I call main splitter. What I would like to know is how to get the QTreeView and QDialog to fill in the extra space when the user maximizes the screen or resizes it to a larger size. I have tried the mainSplitter->addStretchFactor(0, 1) for QTreeView and mainSplitter->addStretchFactor(1,1) for QDialog but that doesn't seem to work :(.

Thanks for any help!

8th March 2011, 22:53
Ok so maybe I miss spoke about this or this is an inherit problem with using QSplitter. So as I said before I have a custom class that is a sublcass of QTreeView on the left side of the QSplitter, and I have a custom class that is a sublcass of QDialog on the right side of the QSplitter object. The QSplitter object is then set as the central widget of QMainWindow. The problem arises when the QMainWindow is maximized, neither the QTreeView or QDialog fill in the expanded area. I have tried several different ways of making it work and I seem to be missing something. If anyone has any ideas that would be greatly appreciated. Thanks!