When the window contains QWebView
and QGraphicsView
, the Grid Layout
setting does not divide the spaces equally.
Is there good way to separate the two spaces equally with the window resize compatibility?
You can set the stretch values for the widgets inside the layout. For example set the horizontal stretches of all the widgets to 1 for equal widths :
webView.sizePolicy.setHorizontalStretch(1)
graphicsView.sizePolicy.setHorizontalStretch(1)
If you want a specific column to be wider, set a higher stretch value for the widget in that column. The same is true for widget heights in different rows of layout.
You can also set the stretch values in the designer. Just click on a widget and on properties pane set Horizontal Stretch and Vertical Stretch from sizePolicy section.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With