QwtDynGridLayout(3)

πŸ’– NAME πŸ’–

QwtDynGridLayout(3) from the Library Functions Manual β€” okay bestie, this is the QwtDynGridLayout class, and its whole vibe is: lays out widgets in a grid, adjusting the number of columns and rows to the current size. Slay. πŸ’…βœ¨


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <qwt_dyngrid_layout.h>

Inherits QLayout.

🌸 Public Member Functions 🌸

  • QwtDynGridLayout (QWidget *, int margin=0, int spacing=-1)
  • QwtDynGridLayout (int spacing=-1)
  • virtual ~QwtDynGridLayout () β€” Destructor.
  • virtual void invalidate () override β€” Invalidate all internal caches.
  • void setMaxColumns (uint maxColumns)
  • uint maxColumns () const β€” Return the upper limit for the number of columns.
  • uint numRows () const
  • uint numColumns () const
  • virtual void addItem (QLayoutItem *) override β€” Add an item to the next free position.
  • virtual QLayoutItem * itemAt (int index) const override
  • virtual QLayoutItem * takeAt (int index) override
  • virtual int count () const override
  • void setExpandingDirections (Qt::Orientations)
  • virtual Qt::Orientations expandingDirections () const override β€” Returns whether this layout can make use of more space than sizeHint().
  • QList< QRect > layoutItems (const QRect &, uint numColumns) const
  • virtual int maxItemWidth () const
  • virtual void setGeometry (const QRect &) override
  • virtual bool hasHeightForWidth () const override
  • virtual int heightForWidth (int) const override
  • virtual QSize sizeHint () const override
  • virtual bool isEmpty () const override
  • uint itemCount () const
  • virtual uint columnsForWidth (int width) const β€” Calculate the number of columns for a given width.

🧚 Protected Member Functions 🧚

  • void layoutGrid (uint numColumns, QVector< int > &rowHeight, QVector< int > &colWidth) const
  • void stretchGrid (const QRect &rect, uint numColumns, QVector< int > &rowHeight, QVector< int > &colWidth) const

🌸 Detailed Description 🌸

The QwtDynGridLayout class lays out widgets in a grid, adjusting the number of columns and rows to the current size. ✨

QwtDynGridLayout takes the space it gets, divides it up into rows and columns, and puts each of the widgets it manages into the correct cell(s). It lays out as many number of columns as possible (limited by maxColumns()). πŸ‘‘

πŸ“ Definition at line 27 of file qwt_dyngrid_layout.h.

πŸŽ€ Constructor & Destructor Documentation πŸŽ€

πŸ’– QwtDynGridLayout::QwtDynGridLayout (QWidget * parent, int margin = 0, int spacing = -1) [explicit] πŸ’–

Okay so this constructor takes:

  • parent β€” Parent widget
  • margin β€” Margin
  • spacing β€” Spacing
πŸ“ Definition at line 58 of file qwt_dyngrid_layout.cpp.

πŸ’– QwtDynGridLayout::QwtDynGridLayout (int spacing = -1) [explicit] πŸ’–

  • spacing β€” Spacing
πŸ“ Definition at line 71 of file qwt_dyngrid_layout.cpp.

πŸ’– QwtDynGridLayout::~QwtDynGridLayout () [virtual] πŸ’–

Destructor. 🫢

πŸ“ Definition at line 88 of file qwt_dyngrid_layout.cpp.

✨ Member Function Documentation ✨

✨ void QwtDynGridLayout::addItem (QLayoutItem * item) [override], [virtual] ✨

Add an item to the next free position. 🎯

  • item β€” Layout item
πŸ“ Definition at line 128 of file qwt_dyngrid_layout.cpp.

✨ uint QwtDynGridLayout::columnsForWidth (int width) const [virtual] ✨

Calculate the number of columns for a given width. The calculation tries to use as many columns as possible ( limited by maxColumns() ). 🌈

  • width β€” Available width for all columns

Returns: Number of columns for a given width

See also: maxColumns(), setMaxColumns()

πŸ“ Definition at line 256 of file qwt_dyngrid_layout.cpp.

✨ int QwtDynGridLayout::count () const [override], [virtual] ✨

Returns: Number of items in the layout

πŸ“ Definition at line 182 of file qwt_dyngrid_layout.cpp.

✨ Qt::Orientations QwtDynGridLayout::expandingDirections () const [override], [virtual] ✨

Returns whether this layout can make use of more space than sizeHint(). A value of Qt::Vertical or Qt::Horizontal means that it wants to grow in only one dimension, while Qt::Vertical | Qt::Horizontal means that it wants to grow in both dimensions. πŸ‘‘

Returns: Orientations, where the layout expands

See also: setExpandingDirections()

πŸ“ Definition at line 211 of file qwt_dyngrid_layout.cpp.

✨ bool QwtDynGridLayout::hasHeightForWidth () const [override], [virtual] ✨

Returns: true: QwtDynGridLayout implements heightForWidth().

See also: heightForWidth()

πŸ“ Definition at line 446 of file qwt_dyngrid_layout.cpp.

✨ int QwtDynGridLayout::heightForWidth (int width) const [override], [virtual] ✨

Returns: The preferred height for this layout, given a width.

See also: hasHeightForWidth()

πŸ“ Definition at line 455 of file qwt_dyngrid_layout.cpp.

✨ void QwtDynGridLayout::invalidate () [override], [virtual] ✨

Invalidate all internal caches. 🧹

πŸ“ Definition at line 95 of file qwt_dyngrid_layout.cpp.

✨ bool QwtDynGridLayout::isEmpty () const [override], [virtual] ✨

Returns: true if this layout is empty.

πŸ“ Definition at line 137 of file qwt_dyngrid_layout.cpp.

✨ QLayoutItem * QwtDynGridLayout::itemAt (int index) const [override], [virtual] ✨

Find the item at a specific index πŸ”Ž

  • index β€” Index

Returns: Item at a specific index

See also: takeAt()

πŸ“ Definition at line 157 of file qwt_dyngrid_layout.cpp.

✨ uint QwtDynGridLayout::itemCount () const ✨

Returns: number of layout items

πŸ“ Definition at line 145 of file qwt_dyngrid_layout.cpp.

✨ void QwtDynGridLayout::layoutGrid (uint numColumns, QVector< int > & rowHeight, QVector< int > & colWidth) const [protected] ✨

Calculate the dimensions for the columns and rows for a grid of numColumns columns. πŸ“

  • numColumns β€” Number of columns.
  • rowHeight β€” Array where to fill in the calculated row heights.
  • colWidth β€” Array where to fill in the calculated column widths.
πŸ“ Definition at line 419 of file qwt_dyngrid_layout.cpp.

✨ QList< QRect > QwtDynGridLayout::layoutItems (const QRect & rect, uint numColumns) const ✨

Calculate the geometries of the layout items for a layout with numColumns columns and a given rectangle. πŸŽ€

  • rect β€” Rect where to place the items
  • numColumns β€” Number of columns

Returns: item geometries

πŸ“ Definition at line 344 of file qwt_dyngrid_layout.cpp.

✨ uint QwtDynGridLayout::maxColumns () const ✨

Return the upper limit for the number of columns. 0 means unlimited, what is the default. ♾️

Returns: Upper limit for the number of columns

See also: setMaxColumns()

πŸ“ Definition at line 119 of file qwt_dyngrid_layout.cpp.

✨ int QwtDynGridLayout::maxItemWidth () const [virtual] ✨

Returns: the maximum width of all layout items

πŸ“ Definition at line 316 of file qwt_dyngrid_layout.cpp.

✨ uint QwtDynGridLayout::numColumns () const ✨

Returns: Number of columns of the current layout.

See also: numRows()

⚠️ Warning: The number of columns might change whenever the geometry changes
πŸ“ Definition at line 596 of file qwt_dyngrid_layout.cpp.

✨ uint QwtDynGridLayout::numRows () const ✨

Returns: Number of rows of the current layout.

See also: numColumns()

⚠️ Warning: The number of rows might change whenever the geometry changes
πŸ“ Definition at line 586 of file qwt_dyngrid_layout.cpp.

✨ void QwtDynGridLayout::setExpandingDirections (Qt::Orientations expanding) ✨

Set whether this layout can make use of more space than sizeHint(). A value of Qt::Vertical or Qt::Horizontal means that it wants to grow in only one dimension, while Qt::Vertical | Qt::Horizontal means that it wants to grow in both dimensions. The default value is 0. 🌈

  • expanding β€” Or'd orientations

See also: expandingDirections()

πŸ“ Definition at line 196 of file qwt_dyngrid_layout.cpp.

✨ void QwtDynGridLayout::setGeometry (const QRect & rect) [override], [virtual] ✨

Reorganizes columns and rows and resizes managed items within a rectangle. 🧩

  • rect β€” Layout geometry
πŸ“ Definition at line 222 of file qwt_dyngrid_layout.cpp.

✨ void QwtDynGridLayout::setMaxColumns (uint maxColumns) ✨

Limit the number of columns.

  • maxColumns β€” upper limit, 0 means unlimited

See also: maxColumns()

πŸ“ Definition at line 106 of file qwt_dyngrid_layout.cpp.

✨ QSize QwtDynGridLayout::sizeHint () const [override], [virtual] ✨

Return the size hint. If maxColumns() > 0 it is the size for a grid with maxColumns() columns, otherwise it is the size for a grid with only one row. πŸ‘‘

Returns: Size hint

See also: maxColumns(), setMaxColumns()

πŸ“ Definition at line 550 of file qwt_dyngrid_layout.cpp.

✨ void QwtDynGridLayout::stretchGrid (const QRect & rect, uint numColumns, QVector< int > & rowHeight, QVector< int > & colWidth) const [protected] ✨

Stretch columns in case of expanding() & QSizePolicy::Horizontal and rows in case of expanding() & QSizePolicy::Vertical to fill the entire rect. Rows and columns are stretched with the same factor. πŸ’ͺ

  • rect β€” Bounding rectangle
  • numColumns β€” Number of columns
  • rowHeight β€” Array to be filled with the calculated row heights
  • colWidth β€” Array to be filled with the calculated column widths

See also: setExpanding(), expanding()

πŸ“ Definition at line 491 of file qwt_dyngrid_layout.cpp.

✨ QLayoutItem * QwtDynGridLayout::takeAt (int index) [override], [virtual] ✨

Find the item at a specific index and remove it from the layout πŸ‘‹

  • index β€” Index

Returns: Layout item, removed from the layout

See also: itemAt()

πŸ“ Definition at line 172 of file qwt_dyngrid_layout.cpp.

πŸ’… Author πŸ’…

Generated automatically by Doxygen for Qwt User's Guide from the source code.

Okay bye bestie πŸ«ΆπŸ’– β€” this was the Qwt User's Guide page for QwtDynGridLayout(3). The footer on the original just points at Qwt User's Guide and QwtDynGridLayout(3); no extra date is listed here, so that’s the whole cute sign-off. Slay. ✨

πŸ“¦ where this page comes from