Cockatrice 2025-11-30-Development-2.11.0-beta.38
A cross-platform virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
FlowWidget Class Referencefinal

#include <flow_widget.h>

Inheritance diagram for FlowWidget:
[legend]
Collaboration diagram for FlowWidget:
[legend]

Public Slots

void setMinimumSizeToMaxSizeHint ()
 Sets the minimum size for all widgets inside the FlowWidget to the maximum sizeHint of all of them.

Public Member Functions

 FlowWidget (QWidget *parent, Qt::Orientation orientation, Qt::ScrollBarPolicy horizontalPolicy, Qt::ScrollBarPolicy verticalPolicy)
 Constructs a FlowWidget with a scrollable layout.
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 ()
 Clears all widgets from the flow layout.
int count () const
QLayoutItem * itemAt (int index) const

Public Attributes

QScrollArea * scrollArea

Protected Member Functions

void resizeEvent (QResizeEvent *event) override
 Handles resize events for the FlowWidget.

Private Attributes

Qt::Orientation flowDirection
QHBoxLayout * mainLayout
FlowLayoutflowLayout
QWidget * container

Constructor & Destructor Documentation

◆ FlowWidget()

FlowWidget::FlowWidget ( QWidget * parent,
Qt::Orientation orientation,
Qt::ScrollBarPolicy horizontalPolicy,
Qt::ScrollBarPolicy verticalPolicy )

Constructs a FlowWidget with a scrollable layout.

Parameters
parentThe parent widget of this FlowWidget.
horizontalPolicyThe horizontal scroll bar policy for the scroll area.
verticalPolicyThe vertical scroll bar policy for the scroll area.

Member Function Documentation

◆ addWidget()

void FlowWidget::addWidget ( QWidget * widget_to_add) const

Adds a widget to the flow layout within the FlowWidget.

Adjusts the widget's size policy based on the scroll bar policies.

Parameters
widget_to_addThe widget to add to the flow layout.
Here is the caller graph for this function:

◆ clearLayout()

void FlowWidget::clearLayout ( )

Clears all widgets from the flow layout.

Deletes each widget and layout item, and recreates the flow layout if it was removed.

◆ 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
Here is the caller graph for this function:

◆ resizeEvent()

void FlowWidget::resizeEvent ( QResizeEvent * event)
overrideprotected

Handles resize events for the FlowWidget.

Triggers layout recalculation and adjusts the scroll area content size.

Parameters
eventThe resize event containing the new size information.

◆ setMinimumSizeToMaxSizeHint

void FlowWidget::setMinimumSizeToMaxSizeHint ( )
slot

Sets the minimum size for all widgets inside the FlowWidget to the maximum sizeHint of all of them.

Here is the caller graph for this function:

Member Data Documentation

◆ container

QWidget* FlowWidget::container
private

◆ flowDirection

Qt::Orientation FlowWidget::flowDirection
private

◆ flowLayout

FlowLayout* FlowWidget::flowLayout
private

◆ mainLayout

QHBoxLayout* FlowWidget::mainLayout
private

◆ scrollArea

QScrollArea* FlowWidget::scrollArea

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