FlowLayout
Layout manager that flows widgets like text.
| Inherits | QLayout |
| Group | widgets |
Declared in src/libs/libactivity/layout/FlowLayout.hpp.
Detailed description
FlowLayout arranges child widgets in a flowing pattern similar to word-wrapped text. Widgets are placed left-to-right and wrap to the next row when space runs out.
See also QLayout, MenuActivity.
Member function documentation
insertWidget
void FlowLayout::insertWidget(int index, QWidget *widget)
Insert widget into the flow at index.
The layout adopts widget as addWidget() does, and puts it before the item at index, so the widget flows at that place. An index below 0 or above count() appends the widget. The layout is invalidated, so the next layout pass places the widgets in their new order. No other item moves out of the layout, so a page can put a new card before its last card with no rebuild (trove-navigation §TNV-D-8).
See also addWidget().
setMode
void FlowLayout::setMode(FlowLayout::Mode mode)
Set how a row shares its width to mode.
Mode::Grid, the default, makes equal cells across the row, and each item takes the width of its cell: a row of large icon buttons fills the width. Mode::Pack keeps the width of each item's size hint, between its minimum and its maximum, and packs the row from the left, one spacing apart. A row wraps when the next item does not fit. Cards of a fixed width use it: in a grid, such a card sits in a wider cell, and the rest of the cell is a gap (trove-navigation TNX-28).