PySide6 PySide6 Examples vertical and horizontal policies. sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) MainWindow.setSizePolicy(sizePolicy)