QwtDynGridLayout(3)

πŸ“¦ version 5.2.3a, in epel 9, fedora 43, fedora 44

QwtDynGridLayout(3) πŸ’–

okay so bestie, you're reading the QwtDynGridLayout(3) page from the Qwt User's Guide, and it's literally all about a grid layout that's lowkey alive β€” it changes its rows and columns depending on the size it gets. no cap. πŸ¦‹


✨ NAME ✨

QwtDynGridLayout β€” the dynamic grid layout icon, periodt.


✨ SYNOPSIS ✨

#include <qwt_dyngrid_layout.h>

Public Member Functions

  • QwtDynGridLayout (QWidget *, int margin=0, int space=-1) β€” constructor with a parent widget, a margin, and spacing.
  • QwtDynGridLayout (int space=-1) β€” constructor with just spacing.
  • virtual ~QwtDynGridLayout () β€” destructor, virtual, doing its thing.
  • virtual void addItem (QLayoutItem *) β€” adds an item.
  • virtual uint columnsForWidth (int width) const β€” tells you how many columns fit a given width.
  • virtual int count () const β€” number of items in the layout.
  • virtual Qt::Orientations expandingDirections () const β€” which directions it wants to expand in.
  • virtual bool hasHeightForWidth () const β€” does it implement heightForWidth? yes.
  • virtual int heightForWidth (int) const β€” preferred height for a given width.
  • virtual void invalidate () β€” invalidates the layout.
  • virtual bool isEmpty () const β€” is it empty?
  • virtual QLayoutItem * itemAt (int index) const β€” find the item at a specific index.
  • uint itemCount () const β€” number of layout items.
  • QList< QRect > layoutItems (const QRect &, uint numCols) const β€” calculates item geometries for a rect and number of columns.
  • uint maxCols () const β€” upper limit for columns (0 means unlimited).
  • virtual int maxItemWidth () const β€” maximum width of all layout items.
  • uint numCols () const β€” number of columns in the current layout.
  • uint numRows () const β€” number of rows in the current layout.
  • void setExpandingDirections (Qt::Orientations) β€” set which directions it can expand in.
  • virtual void setGeometry (const QRect &rect) β€” reorganizes and resizes within rect.
  • void setMaxCols (uint maxCols) β€” limit the number of columns.
  • virtual QSize sizeHint () const β€” the size hint.
  • virtual QLayoutItem * takeAt (int index) β€” find item at index and remove it.

Protected Member Functions

  • void layoutGrid (uint numCols, QwtArray< int > &rowHeight, QwtArray< int > &colWidth) const β€” calculates column and row dimensions.
  • void stretchGrid (const QRect &rect, uint numCols, QwtArray< int > &rowHeight, QwtArray< int > &colWidth) const β€” stretches columns and rows to fill the rect.

🌈 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 maxCols()). it's giving adaptive grid realness, fr fr.


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

QwtDynGridLayout::QwtDynGridLayout (QWidget *parent, intmargin = 0, intspacing = -1) [explicit]

Parameters:

  • parent β€” Parent widget
  • margin β€” Margin
  • spacing β€” Spacing

QwtDynGridLayout::QwtDynGridLayout (intspacing = -1) [explicit]

Parameters:

  • spacing β€” Spacing

πŸ’… Member Function Documentation πŸ’…

uint QwtDynGridLayout::columnsForWidth (intwidth) const [virtual]

Calculate the number of columns for a given width. It tries to use as many columns as possible (limited by maxCols()). bestie, it's doing the math so you don't have to. ✨

Parameters:

  • width β€” Available width for all columns

See also:

  • maxCols(), setMaxCols()

int QwtDynGridLayout::count () const [virtual]

Returns:

  • Number of items in the layout

Qt::Orientations QwtDynGridLayout::expandingDirections () const [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.

See also:

  • setExpandingDirections()

bool QwtDynGridLayout::hasHeightForWidth () const [virtual]

Returns:

  • true: QwtDynGridLayout implements heightForWidth.

See also:

  • heightForWidth()

int QwtDynGridLayout::heightForWidth (intwidth) const [virtual]

Returns:

  • The preferred height for this layout, given the width w.

See also:

  • hasHeightForWidth()

bool QwtDynGridLayout::isEmpty () const [virtual]

Returns:

  • true if this layout is empty.

QLayoutItem * QwtDynGridLayout::itemAt (intindex) const [virtual]

Find the item at a spcific index. (yes, original says "spcific", we keep it πŸ’€)

Parameters:

  • index β€” Index

See also:

  • takeAt()

uint QwtDynGridLayout::itemCount () const

Returns:

  • number of layout items

void QwtDynGridLayout::layoutGrid (uintnumCols, QwtArray< int > &rowHeight, QwtArray< int > &colWidth) const [protected]

Calculate the dimensions for the columns and rows for a grid of numCols columns.

Parameters:

  • numCols β€” Number of columns.
  • rowHeight β€” Array where to fill in the calculated row heights.
  • colWidth β€” Array where to fill in the calculated column widths.

QList< QRect > QwtDynGridLayout::layoutItems (const QRect &rect, uintnumCols) const

Calculate the geometries of the layout items for a layout with numCols columns and a given rect.

Parameters:

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

Returns:

  • item geometries

uint QwtDynGridLayout::maxCols () const

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

See also:

  • setMaxCols()

int QwtDynGridLayout::maxItemWidth () const [virtual]

Returns:

  • the maximum width of all layout items

uint QwtDynGridLayout::numCols () const

Returns:

  • Number of columns of the current layout.

See also:

  • numRows()
Warning: The number of columns might change whenever the geometry changes. so don't get too attached, bestie. 😭

uint QwtDynGridLayout::numRows () const

Returns:

  • Number of rows of the current layout.

See also:

  • numCols()
Warning: The number of rows might change whenever the geometry changes. same energy, fr fr.

void QwtDynGridLayout::setExpandingDirections (Qt::Orientationsexpanding)

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.

Parameters:

  • expanding β€” Or'd orientations

See also:

  • expandingDirections()

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

Reorganizes columns and rows and resizes managed widgets within the rectangle rect.

Parameters:

  • rect β€” Layout geometry

void QwtDynGridLayout::setMaxCols (uintmaxCols)

Limit the number of columns.

Parameters:

  • maxCols β€” upper limit, 0 means unlimited

See also:

  • maxCols()

QSize QwtDynGridLayout::sizeHint () const [virtual]

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

See also:

  • maxCols(), setMaxCols()

void QwtDynGridLayout::stretchGrid (const QRect &rect, uintnumCols, QwtArray< int > &rowHeight, QwtArray< 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.

See also:

  • setExpanding(), expanding()

QLayoutItem * QwtDynGridLayout::takeAt (intindex) [virtual]

Find the item at a spcific index and remove it from the layout. (again, "spcific" is iconic, we're keeping it 🫢)

Parameters:

  • index β€” Index

See also:

  • itemAt()

πŸ‘‘ Author πŸ‘‘

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


okay bestie, that's the whole page. it was generated automatically by Doxygen for Qwt User's Guide from the source code, and it's from Version 5.2.3, dated Tue Nov 20 2012. bye, ily, go make a dynamic grid πŸ’–βœ¨

πŸ“¦ where this page comes from