Skip to main content
`Ctrl`+`K`

# `FlowLayout`

This module provides a flow layout for QWidget: `FlowLayout`.

class FlowLayout(parent=None)

  Bases: `QLayout`

  Layout widgets on (possibly) multiple lines in the available width.

  See Qt `QLayout` for API documentation.

  Adapted from C++ Qt FlowLayout example

  Parameters:

    parent (QWidget) – See `QLayout`

  addItem(self, a0: QLayoutItem | None)
  count(self) → int
  itemAt(self, index: int) → QLayoutItem | None
  takeAt(self, index: int) → QLayoutItem | None
  expandingDirections(self) → Qt.Orientations
  hasHeightForWidth(self) → bool
  heightForWidth(self, a0: int) → int
  setGeometry(self, a0: QRect)
  sizeHint(self) → QSize
  minimumSize(self) → QSize
  setHorizontalSpacing(spacing)

    Set the horizontal spacing between widgets laid out side by side

    Parameters:

      spacing (int)

  horizontalSpacing()

    Returns the horizontal spacing between widgets laid out side by side

    Return type:

      int

  setVerticalSpacing(spacing)

    Set the vertical spacing between lines

    Parameters:

      spacing (int)

  verticalSpacing()

    Returns the vertical spacing between lines

    Return type:

      int