Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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 309 of file qgridlayoutengine_p.h.

Constructor & Destructor Documentation

◆ QGridLayoutEngine()

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

Definition at line 760 of file qgridlayoutengine.cpp.

References invalidate(), and Qt::LeftToRight.

+ Here is the call graph for this function:

◆ ~QGridLayoutEngine()

QGridLayoutEngine::~QGridLayoutEngine ( )
inline

Definition at line 313 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 977 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 1064 of file qgridlayoutengine.cpp.

References columnCount(), qMax(), and rowCount().

+ Here is the call graph for this function:

◆ columnCount() [1/2]

int QGridLayoutEngine::columnCount ( ) const
inline

Definition at line 318 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 775 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 1647 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 1143 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 355 of file qgridlayoutengine_p.h.

References 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 931 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 791 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 797 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 1614 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 1637 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 956 of file qgridlayoutengine.cpp.

References QList< T >::append(), i, QList< T >::insert(), item, itemAt(), j, q_items, qPrintable, 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 368 of file qgridlayoutengine_p.h.

◆ invalidate()

void QGridLayoutEngine::invalidate ( )

Definition at line 1008 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 785 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 999 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 780 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 982 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 370 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 925 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 317 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 770 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 879 of file qgridlayoutengine.cpp.

◆ rowSpacing()

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

Definition at line 836 of file qgridlayoutengine.cpp.

References spacing.

◆ rowStretchFactor()

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

Definition at line 857 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 1025 of file qgridlayoutengine.cpp.

References Qt::AlignBaseline, QList< T >::at(), columnCount(), effectiveAlignment(), i, item, QRectF::moveLeft(), QRectF::moveTop(), q_items, rowCount(), QList< T >::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 912 of file qgridlayoutengine.cpp.

References alignment, and Q_ASSERT.

◆ setRowSizeHint()

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

Definition at line 865 of file qgridlayoutengine.cpp.

References Q_ASSERT.

◆ setRowSpacing()

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

Definition at line 822 of file qgridlayoutengine.cpp.

References invalidate(), Q_ASSERT, and spacing.

+ Here is the call graph for this function:

◆ setRowStretchFactor()

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

Definition at line 844 of file qgridlayoutengine.cpp.

References Q_ASSERT.

◆ setSpacing()

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

Definition at line 803 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 903 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 889 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 1170 of file qgridlayoutengine.cpp.

References direction.

◆ sizeHint()

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

Definition at line 1089 of file qgridlayoutengine.cpp.

References QGridLayoutRowData::calculateGeometries(), columnCount(), constraintOrientation(), hasDynamicConstraint(), QSizeF::height(), Qt::Horizontal, 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 813 of file qgridlayoutengine.cpp.

References QAbstractLayoutStyleInfo::spacing().

+ Here is the call graph for this function:

◆ transpose()

void QGridLayoutEngine::transpose ( )

Definition at line 1157 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 898 of file qgridlayoutengine.cpp.

Referenced by setUniformCellHeights().

+ Here is the caller graph for this function:

◆ uniformCellWidths()

bool QGridLayoutEngine::uniformCellWidths ( ) const

Definition at line 884 of file qgridlayoutengine.cpp.

Referenced by setUniformCellWidths().

+ Here is the caller graph for this function:

◆ visualDirection()

Qt::LayoutDirection QGridLayoutEngine::visualDirection ( ) const

Definition at line 1175 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 456 of file qgridlayoutengine_p.h.

Member Data Documentation

◆ q_items


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