76 spacing = self.spacing()
79 style = item.widget().style()
80 layout_spacing_x = style.layoutSpacing(
81 QSizePolicy.ControlType.PushButton, QSizePolicy.ControlType.PushButton, Qt.Orientation.Horizontal
83 layout_spacing_y = style.layoutSpacing(
84 QSizePolicy.ControlType.PushButton, QSizePolicy.ControlType.PushButton, Qt.Orientation.Vertical
86 space_x = spacing + layout_spacing_x
87 space_y = spacing + layout_spacing_y
88 next_x = x + item.sizeHint().width() + space_x
89 if next_x - space_x > rect.right()
and line_height > 0:
91 y = y + line_height + space_y
92 next_x = x + item.sizeHint().width() + space_x
96 item.setGeometry(QRect(QPoint(x, y), item.sizeHint()))
99 line_height = max(line_height, item.sizeHint().height())
101 return y + line_height - rect.y()