Cockatrice 2026-06-01-Development-3.1.0-beta.3
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
flow_layout.cpp File Reference

Implementation of FlowLayout — a QLayout that wraps child widgets into rows (Qt::Horizontal flow) or columns (Qt::Vertical flow). More...

#include "flow_layout.h"
#include "../widgets/general/layout_containers/flow_widget.h"
#include <QDebug>
#include <QLayoutItem>
#include <QScrollArea>
#include <QStyle>
#include <QWidgetItem>
Include dependency graph for flow_layout.cpp:

Detailed Description

Implementation of FlowLayout — a QLayout that wraps child widgets into rows (Qt::Horizontal flow) or columns (Qt::Vertical flow).

Design contract (following Qt layout conventions):

  • setGeometry() places children inside the given rect. Nothing else.
  • sizeHint() reports the unconstrained preferred size (all items in one line).
  • minimumSize() reports the minimum size (largest single item).
  • heightForWidth() reports the height needed for a given width (horizontal flow only).

The layout never calls setFixedSize() or adjustSize() on its parent widget; that is the responsibility of the parent widget / scroll area.