Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QGridLayoutEngine Class Reference

#include <qgridlayoutengine_p.h>

+ Inheritance diagram for QGridLayoutEngine:
+ Collaboration diagram for QGridLayoutEngine:

Public Member Functions

 QGridLayoutEngine (Qt::Alignment defaultAlignment={ }, bool snapToPixelGrid=false)
 
 ~QGridLayoutEngine ()
 
int rowCount (Qt::Orientation orientation) const
 
int columnCount (Qt::Orientation orientation) const
 
int rowCount () const
 
int columnCount () const
 
int itemCount () const
 
QGridLayoutItemitemAt (int index) const
 
int effectiveFirstRow (Qt::Orientation orientation=Qt::Vertical) const
 
int effectiveLastRow (Qt::Orientation orientation=Qt::Vertical) const
 
void setSpacing (qreal spacing, Qt::Orientations orientations)
 
qreal spacing (Qt::Orientation orientation, const QAbstractLayoutStyleInfo *styleInfo) const
 
void setRowSpacing (int row, qreal spacing, Qt::Orientation orientation=Qt::Vertical)
 
qreal rowSpacing (int row, Qt::Orientation orientation=Qt::Vertical) const
 
void setRowStretchFactor (int row, int stretch, Qt::Orientation orientation=Qt::Vertical)
 
int rowStretchFactor (int row, Qt::Orientation orientation=Qt::Vertical) const
 
void setRowSizeHint (Qt::SizeHint which, int row, qreal size, Qt::Orientation orientation=Qt::Vertical)
 
qreal rowSizeHint (Qt::SizeHint which, int row, Qt::Orientation orientation=Qt::Vertical) const
 
bool uniformCellWidths () const
 
void setUniformCellWidths (bool uniformCellWidths)
 
bool uniformCellHeights () const
 
void setUniformCellHeights (bool uniformCellHeights)
 
void setRowAlignment (int row, Qt::Alignment alignment, Qt::Orientation orientation)
 
Qt::Alignment rowAlignment (int row, Qt::Orientation orientation) const
 
Qt::Alignment effectiveAlignment (const QGridLayoutItem *layoutItem) const
 
void insertItem (QGridLayoutItem *item, int index)
 
void addItem (QGridLayoutItem *item)
 
void removeItem (QGridLayoutItem *item)
 
void deleteItems ()
 
QGridLayoutItemitemAt (int row, int column, Qt::Orientation orientation=Qt::Vertical) const
 
void insertRow (int row, Qt::Orientation orientation=Qt::Vertical)
 
void removeRows (int row, int count, Qt::Orientation orientation)
 
void invalidate ()
 
void setGeometries (const QRectF &contentsGeometry, const QAbstractLayoutStyleInfo *styleInfo)
 
QRectF cellRect (const QRectF &contentsGeometry, int row, int column, int rowSpan, int columnSpan, const QAbstractLayoutStyleInfo *styleInfo) const
 
QSizeF sizeHint (Qt::SizeHint which, const QSizeF &constraint, const QAbstractLayoutStyleInfo *styleInfo) const
 
QSizeF dynamicallyConstrainedSizeHint (Qt::SizeHint which, const QSizeF &constraint) const
 
bool ensureDynamicConstraint () const
 
bool hasDynamicConstraint () const
 
Qt::Orientation constraintOrientation () const
 
QLayoutPolicy::ControlTypes controlTypes (LayoutSide side) const
 
void transpose ()
 
void setVisualDirection (Qt::LayoutDirection direction)
 
Qt::LayoutDirection visualDirection () const
 

Protected Attributes

QList< QGridLayoutItem * > q_items
 

Friends

class QGridLayoutItem
 

Detailed Description

Definition at line 306 of file qgridlayoutengine_p.h.

Constructor & Destructor Documentation

◆ QGridLayoutEngine()

QGridLayoutEngine::QGridLayoutEngine ( Qt::Alignment  defaultAlignment = { },
bool  snapToPixelGrid = false 
)

Definition at line 756 of file qgridlayoutengine.cpp.

References invalidate(), and Qt::LeftToRight.

+ Here is the call graph for this function:

◆ ~QGridLayoutEngine()

QGridLayoutEngine::~QGridLayoutEngine ( )
inline

Definition at line 310 of file qgridlayoutengine_p.h.

References qDeleteAll().

+ Here is the call graph for this function:

Member Function Documentation

◆ addItem()

void QGridLayoutEngine::addItem ( QGridLayoutItem item)

Definition at line 970 of file qgridlayoutengine.cpp.

References insertItem(), and item.

+ Here is the call graph for this function:

◆ cellRect()

QRectF QGridLayoutEngine::cellRect ( const QRectF contentsGeometry,
int  row,
int  column,
int  rowSpan,
int  columnSpan,
const QAbstractLayoutStyleInfo styleInfo 
) const

Definition at line 1057 of file qgridlayoutengine.cpp.

References columnCount(), qMax(), rowCount(), QRectF::size(), QRectF::x(), and QRectF::y().

+ Here is the call graph for this function:

◆ columnCount() [1/2]

int QGridLayoutEngine::columnCount ( ) const
inline

Definition at line 315 of file qgridlayoutengine_p.h.

References Qt::Horizontal.

Referenced by cellRect(), controlTypes(), itemAt(), setGeometries(), and sizeHint().

+ Here is the caller graph for this function:

◆ columnCount() [2/2]

int QGridLayoutEngine::columnCount ( Qt::Orientation  orientation) const

Definition at line 771 of file qgridlayoutengine.cpp.

References QHVContainer< T >::transposed().

Referenced by QGraphicsLinearLayoutPrivate::gridColumn().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ constraintOrientation()

Qt::Orientation QGridLayoutEngine::constraintOrientation ( ) const

Definition at line 1640 of file qgridlayoutengine.cpp.

References ensureDynamicConstraint(), and void.

Referenced by sizeHint().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ controlTypes()

QLayoutPolicy::ControlTypes QGridLayoutEngine::controlTypes ( LayoutSide  side) const

Definition at line 1136 of file qgridlayoutengine.cpp.

References Bottom, columnCount(), effectiveFirstRow(), effectiveLastRow(), Qt::Horizontal, item, itemAt(), Left, Top, and Qt::Vertical.

+ Here is the call graph for this function:

◆ deleteItems()

void QGridLayoutEngine::deleteItems ( )
inline

Definition at line 352 of file qgridlayoutengine_p.h.

References QList< T >::clear(), Qt::Horizontal, qDeleteAll(), and Qt::Vertical.

+ Here is the call graph for this function:

◆ dynamicallyConstrainedSizeHint()

QSizeF QGridLayoutEngine::dynamicallyConstrainedSizeHint ( Qt::SizeHint  which,
const QSizeF constraint 
) const

◆ effectiveAlignment()

Qt::Alignment QGridLayoutEngine::effectiveAlignment ( const QGridLayoutItem layoutItem) const

Definition at line 927 of file qgridlayoutengine.cpp.

References Qt::AlignHorizontal_Mask, Qt::AlignVertical_Mask, Qt::Horizontal, layoutItem(), rowAlignment(), and Qt::Vertical.

Referenced by setGeometries().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ effectiveFirstRow()

int QGridLayoutEngine::effectiveFirstRow ( Qt::Orientation  orientation = Qt::Vertical) const

Definition at line 787 of file qgridlayoutengine.cpp.

Referenced by controlTypes().

+ Here is the caller graph for this function:

◆ effectiveLastRow()

int QGridLayoutEngine::effectiveLastRow ( Qt::Orientation  orientation = Qt::Vertical) const

Definition at line 793 of file qgridlayoutengine.cpp.

Referenced by controlTypes().

+ Here is the caller graph for this function:

◆ ensureDynamicConstraint()

bool QGridLayoutEngine::ensureDynamicConstraint ( ) const

returns false if the layout has contradicting constraints (i.e. some items with a horizontal constraint and other items with a vertical constraint)

Definition at line 1607 of file qgridlayoutengine.cpp.

References QList< T >::at(), i, item, NoConstraint, q_items, qWarning, QList< T >::size(), UnfeasibleConstraint, and UnknownConstraint.

Referenced by constraintOrientation(), and hasDynamicConstraint().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasDynamicConstraint()

bool QGridLayoutEngine::hasDynamicConstraint ( ) const

Definition at line 1630 of file qgridlayoutengine.cpp.

References ensureDynamicConstraint(), and NoConstraint.

Referenced by sizeHint().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertItem()

void QGridLayoutEngine::insertItem ( QGridLayoutItem item,
int  index 
)

The index is only used by QGraphicsLinearLayout to ensure that itemAt() reflects the order of visual arrangement. Strictly speaking it does not have to, but most people expect it to. (And if it didn't we would have to add itemArrangedAt(int index) or something..)

Definition at line 952 of file qgridlayoutengine.cpp.

References QList< T >::append(), i, QList< T >::insert(), item, itemAt(), j, q_items, qWarning, and QList< T >::size().

Referenced by addItem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertRow()

void QGridLayoutEngine::insertRow ( int  row,
Qt::Orientation  orientation = Qt::Vertical 
)
inline

Definition at line 365 of file qgridlayoutengine_p.h.

◆ invalidate()

void QGridLayoutEngine::invalidate ( )

Definition at line 1001 of file qgridlayoutengine.cpp.

References UnknownConstraint.

Referenced by QGridLayoutEngine(), removeItem(), QGraphicsGridLayoutEngine::setAlignment(), QQuickGridLayoutEngine::setAlignment(), setRowSpacing(), setSpacing(), QQuickGridLayoutEngine::setStretchFactor(), setUniformCellHeights(), setUniformCellWidths(), and transpose().

+ Here is the caller graph for this function:

◆ itemAt() [1/2]

QGridLayoutItem * QGridLayoutEngine::itemAt ( int  index) const

Definition at line 781 of file qgridlayoutengine.cpp.

References QList< T >::at(), itemCount(), Q_ASSERT, and q_items.

Referenced by controlTypes(), insertItem(), and removeItem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ itemAt() [2/2]

QGridLayoutItem * QGridLayoutEngine::itemAt ( int  row,
int  column,
Qt::Orientation  orientation = Qt::Vertical 
) const

Definition at line 992 of file qgridlayoutengine.cpp.

References QList< T >::at(), columnCount(), Qt::Horizontal, qSwap(), and rowCount().

+ Here is the call graph for this function:

◆ itemCount()

int QGridLayoutEngine::itemCount ( ) const

Definition at line 776 of file qgridlayoutengine.cpp.

References q_items, and QList< T >::size().

Referenced by itemAt().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeItem()

void QGridLayoutEngine::removeItem ( QGridLayoutItem item)

Definition at line 975 of file qgridlayoutengine.cpp.

References QListSpecialMethodsBase< T >::contains(), i, invalidate(), item, itemAt(), j, Q_ASSERT, q_items, and QList< T >::removeAll().

Referenced by QGraphicsLinearLayoutPrivate::removeGridItem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeRows()

void QGridLayoutEngine::removeRows ( int  row,
int  count,
Qt::Orientation  orientation 
)
inline

Definition at line 367 of file qgridlayoutengine_p.h.

Referenced by QGraphicsLinearLayoutPrivate::removeGridItem().

+ Here is the caller graph for this function:

◆ rowAlignment()

Qt::Alignment QGridLayoutEngine::rowAlignment ( int  row,
Qt::Orientation  orientation 
) const

Definition at line 921 of file qgridlayoutengine.cpp.

References Q_ASSERT.

Referenced by effectiveAlignment().

+ Here is the caller graph for this function:

◆ rowCount() [1/2]

int QGridLayoutEngine::rowCount ( ) const
inline

Definition at line 314 of file qgridlayoutengine_p.h.

References Qt::Vertical.

Referenced by cellRect(), itemAt(), setGeometries(), and sizeHint().

+ Here is the caller graph for this function:

◆ rowCount() [2/2]

int QGridLayoutEngine::rowCount ( Qt::Orientation  orientation) const

Definition at line 766 of file qgridlayoutengine.cpp.

Referenced by QGraphicsLinearLayoutPrivate::fixIndex(), and QGraphicsLinearLayoutPrivate::gridRow().

+ Here is the caller graph for this function:

◆ rowSizeHint()

qreal QGridLayoutEngine::rowSizeHint ( Qt::SizeHint  which,
int  row,
Qt::Orientation  orientation = Qt::Vertical 
) const

Definition at line 875 of file qgridlayoutengine.cpp.

◆ rowSpacing()

qreal QGridLayoutEngine::rowSpacing ( int  row,
Qt::Orientation  orientation = Qt::Vertical 
) const

Definition at line 832 of file qgridlayoutengine.cpp.

References spacing.

◆ rowStretchFactor()

int QGridLayoutEngine::rowStretchFactor ( int  row,
Qt::Orientation  orientation = Qt::Vertical 
) const

Definition at line 853 of file qgridlayoutengine.cpp.

References QLayoutParameter< T >::isDefault(), and QLayoutParameter< T >::value().

+ Here is the call graph for this function:

◆ setGeometries()

void QGridLayoutEngine::setGeometries ( const QRectF contentsGeometry,
const QAbstractLayoutStyleInfo styleInfo 
)

Definition at line 1018 of file qgridlayoutengine.cpp.

References Qt::AlignBaseline, QList< T >::at(), columnCount(), effectiveAlignment(), i, item, QRectF::moveLeft(), QRectF::moveTop(), q_items, rowCount(), QList< T >::size(), QRectF::size(), visualDirection(), visualRect(), QRectF::x(), and QRectF::y().

+ Here is the call graph for this function:

◆ setRowAlignment()

void QGridLayoutEngine::setRowAlignment ( int  row,
Qt::Alignment  alignment,
Qt::Orientation  orientation 
)

Definition at line 908 of file qgridlayoutengine.cpp.

References alignment, QGridLayoutRowInfo::alignments, Q_ASSERT, QList< T >::resize(), and QList< T >::size().

+ Here is the call graph for this function:

◆ setRowSizeHint()

void QGridLayoutEngine::setRowSizeHint ( Qt::SizeHint  which,
int  row,
qreal  size,
Qt::Orientation  orientation = Qt::Vertical 
)

Definition at line 861 of file qgridlayoutengine.cpp.

References QGridLayoutRowInfo::boxes, Q_ASSERT, QList< T >::resize(), and QList< T >::size().

+ Here is the call graph for this function:

◆ setRowSpacing()

void QGridLayoutEngine::setRowSpacing ( int  row,
qreal  spacing,
Qt::Orientation  orientation = Qt::Vertical 
)

Definition at line 818 of file qgridlayoutengine.cpp.

References invalidate(), Q_ASSERT, QList< T >::resize(), QList< T >::size(), spacing, and QGridLayoutRowInfo::spacings.

+ Here is the call graph for this function:

◆ setRowStretchFactor()

void QGridLayoutEngine::setRowStretchFactor ( int  row,
int  stretch,
Qt::Orientation  orientation = Qt::Vertical 
)

Definition at line 840 of file qgridlayoutengine.cpp.

References Q_ASSERT, QList< T >::resize(), QList< T >::size(), and QGridLayoutRowInfo::stretches.

+ Here is the call graph for this function:

◆ setSpacing()

void QGridLayoutEngine::setSpacing ( qreal  spacing,
Qt::Orientations  orientations 
)

Definition at line 799 of file qgridlayoutengine.cpp.

References Qt::Horizontal, invalidate(), spacing, and Qt::Vertical.

+ Here is the call graph for this function:

◆ setUniformCellHeights()

void QGridLayoutEngine::setUniformCellHeights ( bool  uniformCellHeights)

Definition at line 899 of file qgridlayoutengine.cpp.

References invalidate(), and uniformCellHeights().

+ Here is the call graph for this function:

◆ setUniformCellWidths()

void QGridLayoutEngine::setUniformCellWidths ( bool  uniformCellWidths)

Definition at line 885 of file qgridlayoutengine.cpp.

References invalidate(), and uniformCellWidths().

+ Here is the call graph for this function:

◆ setVisualDirection()

void QGridLayoutEngine::setVisualDirection ( Qt::LayoutDirection  direction)

Definition at line 1163 of file qgridlayoutengine.cpp.

References direction.

◆ sizeHint()

QSizeF QGridLayoutEngine::sizeHint ( Qt::SizeHint  which,
const QSizeF constraint,
const QAbstractLayoutStyleInfo styleInfo 
) const

Definition at line 1082 of file qgridlayoutengine.cpp.

References QGridLayoutRowData::calculateGeometries(), columnCount(), constraintOrientation(), QList< T >::data(), hasDynamicConstraint(), QSizeF::height(), Qt::Horizontal, QList< T >::resize(), rowCount(), Qt::Vertical, and QSizeF::width().

+ Here is the call graph for this function:

◆ spacing()

qreal QGridLayoutEngine::spacing ( Qt::Orientation  orientation,
const QAbstractLayoutStyleInfo styleInfo 
) const

Definition at line 809 of file qgridlayoutengine.cpp.

References QAbstractLayoutStyleInfo::spacing().

+ Here is the call graph for this function:

◆ transpose()

void QGridLayoutEngine::transpose ( )

Definition at line 1150 of file qgridlayoutengine.cpp.

References QList< T >::at(), i, invalidate(), q_items, QList< T >::size(), QGridLayoutItem::transpose(), and QHVContainer< T >::transpose().

+ Here is the call graph for this function:

◆ uniformCellHeights()

bool QGridLayoutEngine::uniformCellHeights ( ) const

Definition at line 894 of file qgridlayoutengine.cpp.

Referenced by setUniformCellHeights().

+ Here is the caller graph for this function:

◆ uniformCellWidths()

bool QGridLayoutEngine::uniformCellWidths ( ) const

Definition at line 880 of file qgridlayoutengine.cpp.

Referenced by setUniformCellWidths().

+ Here is the caller graph for this function:

◆ visualDirection()

Qt::LayoutDirection QGridLayoutEngine::visualDirection ( ) const

Definition at line 1168 of file qgridlayoutengine.cpp.

Referenced by setGeometries().

+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ QGridLayoutItem

friend class QGridLayoutItem
friend

Definition at line 453 of file qgridlayoutengine_p.h.

Member Data Documentation

◆ q_items


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