I am designing a simple GUI that includes a QSplitter containing a QListWidget and a QGraphicsView coupled horizontally. I want the list widget on the left side occupying 20% of the splitter container and the graphics view on the right side occupying 80% of the splitter. I want the user to be able to adjust these ratios by dragging the splitter bar, so I cannot fix these values. Here is approximately how I want it to look:
Capture1.PNG

It actually works fine when I set the horizontal stretches to 20 and 80 (as seen in the above picture) until I set the graphics view scene with QGraphicsView::setScene(). Then the splitter bar moves over to the right side of the window like this:
Capture2.PNG

It seems to give the QGraphicsView widget the minimum amount of space allowed in the splitter. I tried setting the horizontal stretch again after setting the scene like this:
Qt Code:
  1. ui.graphicsView->setScene(scene);
  2. ui.graphicsView->sizePolicy().setHorizontalStretch(80);
To copy to clipboard, switch view to plain text mode 
but it does not seem to make a difference. How can I avoid this resizing when setting the scene? Thanks.