When you addStretch() or insertStretch() to a QBoxLayout, a QSpacerItem is added/inserted to the layout and you can set the stretch factor while doing so. Now I would like to retrieve that stretch factor from the SpacerItem but I can't find how to do so. item.sizePolicy().verticalStretch() always returns 0, as can be demonstrated with this example: from PyQt6.QtWidgets import QApplication, QWidget, QVBoxLayout, QPushButton, QSpacerItem class Window(QWidget): def __init__(self): super().__init__() self.setGeometry(700, 500, 100, 200) self.layout = QVBoxLayout(self) for i in range(3): but = QPushButton(f'Push {i}') self.layout.addWidget(but) if i == 0: but.clicked.connect(self.click) self.layout.insertStretch(1, 2) self.layout.insertStretch(3, 3) def click(self): for i in (1, 3): stretch = self.layout.itemAt(i) assert isinstance(stretch, QSpacerItem) pol = stretch.sizePolicy() print(pol.verticalStretch()) app = QApplication([]) window = Window() window.show() app.exec() So where is the stretch factor stored? and is this info accessible somehow or would I have to keep a separate reference to keep the stretch info available? Continue reading...