QWT API (English) 7.0.1
Qt Widget Library for Technical Applications - English API Documentation
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Member Functions | List of all members
QwtDynGridLayout Class Reference

Dynamic grid layout that adjusts columns and rows to the current size. More...

#include <qwt_dyngrid_layout.h>

Inheritance diagram for QwtDynGridLayout:

Classes

class  PrivateData
 

Public Member Functions

 QwtDynGridLayout (QWidget *, int margin=0, int spacing=-1)
 Constructor with parent widget, margin and spacing.
 
 QwtDynGridLayout (int spacing=-1)
 Constructor with spacing only.
 
virtual ~QwtDynGridLayout ()
 Destructor.
 
virtual void invalidate () override
 Invalidate all internal caches.
 
void setMaxColumns (uint maxColumns)
 Set the upper limit for the number of columns.
 
uint maxColumns () const
 Get the upper limit for the number of columns.
 
uint numRows () const
 Get the number of rows in the current layout.
 
uint numColumns () const
 Get the number of columns in the current layout.
 
virtual void addItem (QLayoutItem *) override
 Add an item to the next free position.
 
virtual QLayoutItem * itemAt (int index) const override
 Get the item at a specific index.
 
virtual QLayoutItem * takeAt (int index) override
 Remove and return the item at a specific index.
 
virtual int count () const override
 Get the number of items in the layout.
 
void setExpandingDirections (Qt::Orientations)
 Set the expanding directions for the layout.
 
virtual Qt::Orientations expandingDirections () const override
 Get the expanding directions for the layout.
 
QList< QRect > layoutItems (const QRect &, uint numColumns) const
 Calculate the geometries of the layout items.
 
virtual int maxItemWidth () const
 Get the maximum width of all layout items.
 
virtual void setGeometry (const QRect &) override
 Set the geometry for the layout.
 
virtual bool hasHeightForWidth () const override
 Check if the layout has height for width.
 
virtual int heightForWidth (int) const override
 Get the preferred height for a given width.
 
virtual QSize sizeHint () const override
 Get the size hint for the layout.
 
virtual bool isEmpty () const override
 Check if the layout is empty.
 
uint itemCount () const
 Get the number of layout items.
 
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
 Calculate the dimensions for the columns and rows for a grid of numColumns columns.
 
void stretchGrid (const QRect &rect, uint numColumns, QVector< int > &rowHeight, QVector< int > &colWidth) const
 Stretch columns in case of expanding() & QSizePolicy::Horizontal and rows in case of expanding() & QSizePolicy::Vertical to fill the entire rect.
 

Detailed Description

Dynamic grid layout that adjusts columns and rows to the current size.

Constructor & Destructor Documentation

◆ QwtDynGridLayout() [1/2]

QwtDynGridLayout::QwtDynGridLayout ( QWidget *  parent,
int  margin = 0,
int  spacing = -1 
)
explicit

Constructor with parent widget, margin and spacing.

◆ QwtDynGridLayout() [2/2]

QwtDynGridLayout::QwtDynGridLayout ( int  spacing = -1)
explicit

Constructor with spacing only.

◆ ~QwtDynGridLayout()

QwtDynGridLayout::~QwtDynGridLayout ( )
virtual

Destructor.

Member Function Documentation

◆ addItem()

void QwtDynGridLayout::addItem ( QLayoutItem *  item)
overridevirtual

Add an item to the next free position.

◆ columnsForWidth()

uint QwtDynGridLayout::columnsForWidth ( int  width) const
virtual

Calculate the number of columns for a given width.

◆ count()

int QwtDynGridLayout::count ( ) const
overridevirtual

Get the number of items in the layout.

◆ expandingDirections()

Qt::Orientations QwtDynGridLayout::expandingDirections ( ) const
overridevirtual

Get the expanding directions for the layout.

◆ hasHeightForWidth()

bool QwtDynGridLayout::hasHeightForWidth ( ) const
overridevirtual

Check if the layout has height for width.

◆ heightForWidth()

int QwtDynGridLayout::heightForWidth ( int  width) const
overridevirtual

Get the preferred height for a given width.

◆ invalidate()

void QwtDynGridLayout::invalidate ( )
overridevirtual

Invalidate all internal caches.

◆ isEmpty()

bool QwtDynGridLayout::isEmpty ( ) const
overridevirtual

Check if the layout is empty.

◆ itemAt()

QLayoutItem * QwtDynGridLayout::itemAt ( int  index) const
overridevirtual

Get the item at a specific index.

◆ itemCount()

uint QwtDynGridLayout::itemCount ( ) const

Get the number of layout items.

◆ layoutGrid()

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.

Parameters
numColumnsNumber of columns.
rowHeightArray where to fill in the calculated row heights.
colWidthArray where to fill in the calculated column widths.

◆ layoutItems()

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

Calculate the geometries of the layout items.

◆ maxColumns()

uint QwtDynGridLayout::maxColumns ( ) const

Get the upper limit for the number of columns.

◆ maxItemWidth()

int QwtDynGridLayout::maxItemWidth ( ) const
virtual

Get the maximum width of all layout items.

◆ numColumns()

uint QwtDynGridLayout::numColumns ( ) const

Get the number of columns in the current layout.

◆ numRows()

uint QwtDynGridLayout::numRows ( ) const

Get the number of rows in the current layout.

◆ setExpandingDirections()

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

Set the expanding directions for the layout.

◆ setGeometry()

void QwtDynGridLayout::setGeometry ( const QRect &  rect)
overridevirtual

Set the geometry for the layout.

◆ setMaxColumns()

void QwtDynGridLayout::setMaxColumns ( uint  maxColumns)

Set the upper limit for the number of columns.

◆ sizeHint()

QSize QwtDynGridLayout::sizeHint ( ) const
overridevirtual

Get the size hint for the layout.

◆ stretchGrid()

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.

Parameters
rectBounding rectangle
numColumnsNumber of columns
rowHeightArray to be filled with the calculated row heights
colWidthArray to be filled with the calculated column widths
See also
setExpanding(), expanding()

◆ takeAt()

QLayoutItem * QwtDynGridLayout::takeAt ( int  index)
overridevirtual

Remove and return the item at a specific index.


The documentation for this class was generated from the following files: