Qt Layout doesn't work with plain widget
I am using a plain widget which shows QCustomPlot. I have splitter with two panes, left pane is a QTreeView and right pane is the plot.
Now I am trying to couple other controls in right pane but it does let me me. I want to set QCustomePlot with QLabel on top and than these two will appear in the right pane of splitter but when I group them together using vertical layout, they both overlaps and it doesn't show up correctly.
How can I fix this problem? Thanks
You have to use a container widget for that so something like:
QWidget *container = new QWidget;
QVBoxLayout *vLayout = new QVBoxLayout(container);
Hope it helps
Thanks, that worked! I was able to do it with from Qt Creator itself, place widget and label inside another widget and setting the grid layout.
If someone else is doing similar thing, another nice thing I did to to set the layout nice is for QLabel, I set the vertical sizePolicy to maximum and horizental sizePolicy to 'ignored'. This created the perfect layout that I wanted otherwise the QLabel will take more space in the division.