layout ====== .. py:module:: qfluentwidgets.components.layout .. toctree:: :titlesonly: :maxdepth: 1 expand_layout/index.rst flow_layout/index.rst v_box_layout/index.rst Package Contents ---------------- .. autoapisummary:: qfluentwidgets.components.layout.ExpandLayout qfluentwidgets.components.layout.FlowLayout qfluentwidgets.components.layout.AdaptiveFlowLayout qfluentwidgets.components.layout.VBoxLayout .. py:class:: ExpandLayout(parent=None) Bases: :py:obj:`PyQt5.QtWidgets.QLayout` Expand layout .. py:method:: addWidget(widget: PyQt5.QtWidgets.QWidget) .. py:method:: addItem(item) .. py:method:: count() .. py:method:: itemAt(index) .. py:method:: takeAt(index) .. py:method:: expandingDirections() .. py:method:: hasHeightForWidth() .. py:method:: heightForWidth(width) get the minimal height according to width .. py:method:: setGeometry(rect) .. py:method:: sizeHint() .. py:method:: minimumSize() .. py:method:: eventFilter(obj, e) .. py:class:: FlowLayout(parent=None, needAni=False, isTight=False) Bases: :py:obj:`PyQt5.QtWidgets.QLayout` Flow layout .. py:attribute:: duration :value: 300 .. py:attribute:: ease .. py:attribute:: needAni :value: False .. py:attribute:: isTight :value: False .. py:method:: addItem(item) .. py:method:: insertItem(index, item) .. py:method:: addWidget(w) .. py:method:: insertWidget(index, w) .. py:method:: setAnimation(duration, ease=QEasingCurve.Linear) set the moving animation Parameters ---------- duration: int the duration of animation in milliseconds ease: QEasingCurve the easing curve of animation .. py:method:: count() .. py:method:: itemAt(index: int) .. py:method:: takeAt(index: int) .. py:method:: removeWidget(widget) .. py:method:: removeAllWidgets() remove all widgets from layout .. py:method:: takeAllWidgets() remove all widgets from layout and delete them .. py:method:: expandingDirections() .. py:method:: hasHeightForWidth() .. py:method:: heightForWidth(width: int) get the minimal height according to width .. py:method:: setGeometry(rect: PyQt5.QtCore.QRect) .. py:method:: sizeHint() .. py:method:: minimumSize() .. py:method:: setVerticalSpacing(spacing: int) set vertical spacing between widgets .. py:method:: verticalSpacing() get vertical spacing between widgets .. py:method:: setHorizontalSpacing(spacing: int) set horizontal spacing between widgets .. py:method:: horizontalSpacing() get horizontal spacing between widgets .. py:method:: eventFilter(obj: PyQt5.QtCore.QObject, event: PyQt5.QtCore.QEvent) -> bool .. py:class:: AdaptiveFlowLayout(parent=None, needAni=False, isTight=False) Bases: :py:obj:`FlowLayout` Flow layout .. py:method:: setWidgetMinimumWidth(width: int) .. py:method:: widgetMinimumWidth() .. py:method:: setWidgetMaximumWidth(width) .. py:method:: widgetMaximumWidth() .. py:class:: VBoxLayout(parent) Bases: :py:obj:`PyQt5.QtWidgets.QVBoxLayout` Vertical box layout .. py:attribute:: widgets :value: [] .. py:method:: addWidgets(widgets: List[PyQt5.QtWidgets.QWidget], stretch=0, alignment=Qt.AlignTop) add widgets to layout .. py:method:: addWidget(widget: PyQt5.QtWidgets.QWidget, stretch=0, alignment=Qt.AlignTop) add widget to layout .. py:method:: removeWidget(widget: PyQt5.QtWidgets.QWidget) remove widget from layout but not delete it .. py:method:: deleteWidget(widget: PyQt5.QtWidgets.QWidget) remove widget from layout and delete it .. py:method:: removeAllWidget() remove all widgets from layout