Skip to main content

QCustomFlowWidget

QCustomFlowWidget

A container widget that uses QCustomFlowLayout internally.

ALL custom properties are exposed here for Qt Designer.

At a glance​

TierFree (GPLv3)
Importfrom Custom_Widgets.QCustomFlowWidget import QCustomFlowWidget
Qt DesignerYes — drag it from the palette

Quick start​

from Custom_Widgets.QCustomFlowWidget import QCustomFlowWidget

widget = QCustomFlowWidget()
for chip in _flowChips():
widget.addWidget(chip)

That is the exact code behind the screenshot above.

Dark theme​

Colours come from the design tokens, so the widget follows the app theme with no extra work.

QCustomFlowWidget in dark theme

Properties​

Every property below is settable in code and in Qt Designer.

PropertyTypeDefault
spacingint10
horizontalSpacingint10
verticalSpacingint10
marginint10
animationEnabledboolTrue
animationDurationint300
animationEasingCurvestringOutCubic
equalDistributionboolTrue
autoFillWidthboolFalse
autoFillHeightboolFalse
justifySpacingboolFalse
orderJsonPathstring—

Methods​

MethodDescription
addWidget(widget, position=None)Add a widget to the flow layout
adoptExistingChildren()Adopt existing child widgets from Qt Designer in their original order
animationDuration(*args, **kwargs)Animation duration.
animationEasingCurve(*args, **kwargs)Animation easing curve.
animationEnabled(*args, **kwargs)Animation enabled.
autoFillHeight(*args, **kwargs)Auto fill height.
autoFillWidth(*args, **kwargs)Auto fill width.
childEvent(event)Handle child events to detect when widgets are added
clear()Remove all widgets from the flow layout
equalDistribution(*args, **kwargs)Equal distribution.
getFlowLayout()Get the underlying flow layout
horizontalSpacing(*args, **kwargs)Horizontal spacing.
isAnimating()Check if animations are running
justifySpacing(*args, **kwargs)Justify spacing.
margin(*args, **kwargs)Margin.
orderJsonPath(*args, **kwargs)Order json path.
refreshLayout()Manually refresh the layout
removeWidget(widget)Remove a widget from the flow layout
spacing(*args, **kwargs)Spacing.
stopAllAnimations()Stop all ongoing animations
verticalSpacing(*args, **kwargs)Vertical spacing.

Runnable example​

A complete app using this widget lives at examples/PySide6/QCustomFlowWidget/main.py.

QCustomAccordion · QCustomCardStack · QCustomCarousel · QCustomComponent · QCustomComponentContainer · QCustomComponentLoader · QCustomEmbeddedWindow · QCustomFlowLayout