#include <flow_widget.h>
|
| | FlowWidget (QWidget *parent, Qt::Orientation orientation, Qt::ScrollBarPolicy horizontalPolicy, Qt::ScrollBarPolicy verticalPolicy) |
| | Constructs a FlowWidget.
|
| void | addWidget (QWidget *widget_to_add) const |
| | Adds a widget to the flow layout within the FlowWidget.
|
| void | insertWidgetAtIndex (QWidget *toInsert, int index) |
| void | removeWidget (QWidget *widgetToRemove) const |
| void | clearLayout () |
| | Removes all widgets from the flow layout and deletes them.
|
| int | count () const |
| QLayoutItem * | itemAt (int index) const |
|
| QScrollArea * | scrollArea |
| | Null when both scroll policies are AlwaysOff.
|
|
| void | resizeEvent (QResizeEvent *event) override |
| | Marks the flow layout as dirty so Qt recomputes item positions.
|
◆ FlowWidget()
| FlowWidget::FlowWidget |
( |
QWidget * | parent, |
|
|
Qt::Orientation | orientation, |
|
|
Qt::ScrollBarPolicy | horizontalPolicy, |
|
|
Qt::ScrollBarPolicy | verticalPolicy ) |
Constructs a FlowWidget.
When both scroll policies are Qt::ScrollBarAlwaysOff the scroll area is omitted entirely and the container is placed directly in the main layout.
- Parameters
-
| parent | Parent widget. |
| _flowDirection | Qt::Horizontal for row-wrapping, Qt::Vertical for column-wrapping. |
| horizontalPolicy | Horizontal scroll-bar policy. |
| verticalPolicy | Vertical scroll-bar policy. |
◆ addWidget()
| void FlowWidget::addWidget |
( |
QWidget * | widget_to_add | ) |
const |
Adds a widget to the flow layout within the FlowWidget.
- Parameters
-
| widget_to_add | The widget to add to the flow layout. |
◆ clearLayout()
| void FlowWidget::clearLayout |
( |
| ) |
|
Removes all widgets from the flow layout and deletes them.
If the layout pointer has somehow been lost it is recreated before returning.
◆ count()
| int FlowWidget::count |
( |
| ) |
const |
|
nodiscard |
◆ insertWidgetAtIndex()
| void FlowWidget::insertWidgetAtIndex |
( |
QWidget * | toInsert, |
|
|
int | index ) |
◆ itemAt()
| QLayoutItem * FlowWidget::itemAt |
( |
int | index | ) |
const |
|
nodiscard |
◆ removeWidget()
| void FlowWidget::removeWidget |
( |
QWidget * | widgetToRemove | ) |
const |
◆ resizeEvent()
| void FlowWidget::resizeEvent |
( |
QResizeEvent * | event | ) |
|
|
overrideprotected |
Marks the flow layout as dirty so Qt recomputes item positions.
We do NOT call adjustSize() or activate() here:
- adjustSize() would freeze geometry by calling setFixedSize internally.
- activate() called inside a resize event can cause synchronous re-entrancy. Qt automatically calls setGeometry on the layout after a resize, so simply invalidating is sufficient.
◆ setMinimumSizeToMaxSizeHint
| void FlowWidget::setMinimumSizeToMaxSizeHint |
( |
| ) |
|
|
slot |
Sets every child widget's minimum size to the largest sizeHint in the layout.
Useful for toolbars or button bars where all items should be the same size.
◆ setSpacing
| void FlowWidget::setSpacing |
( |
int | hSpacing, |
|
|
int | vSpacing ) |
|
slot |
◆ container
| QWidget* FlowWidget::container |
|
private |
◆ flowDirection
| Qt::Orientation FlowWidget::flowDirection |
|
private |
◆ flowLayout
◆ mainLayout
| QHBoxLayout* FlowWidget::mainLayout |
|
private |
◆ scrollArea
| QScrollArea* FlowWidget::scrollArea |
Null when both scroll policies are AlwaysOff.
The documentation for this class was generated from the following files:
- cockatrice/src/interface/widgets/general/layout_containers/flow_widget.h
- cockatrice/src/interface/widgets/general/layout_containers/flow_widget.cpp