Qt 4.8
Public Functions | Private Functions | Static Private Functions | Properties | Friends | List of all members
QGridLayoutEngine Class Reference

#include <qgridlayoutengine_p.h>

Public Functions

void addItem (QGridLayoutItem *item)
 
Qt::Alignment alignment (QGraphicsLayoutItem *layoutItem) const
 
QRectF cellRect (const QLayoutStyleInfo &styleInfo, const QRectF &contentsGeometry, int row, int column, int rowSpan, int columnSpan) const
 
int columnCount (Qt::Orientation orientation) const
 
int columnCount () const
 
Qt::Orientation constraintOrientation () const
 
QSizePolicy::ControlTypes controlTypes (LayoutSide side) const
 
void dump (int indent=0) const
 
QSizeF dynamicallyConstrainedSizeHint (Qt::SizeHint which, const QSizeF &constraint) const
 
Qt::Alignment effectiveAlignment (const QGridLayoutItem *layoutItem) const
 
int effectiveFirstRow (Qt::Orientation orientation=Qt::Vertical) const
 
int effectiveLastRow (Qt::Orientation orientation=Qt::Vertical) const
 
bool ensureDynamicConstraint () const
 
QGridLayoutItemfindLayoutItem (QGraphicsLayoutItem *layoutItem) const
 
bool hasDynamicConstraint () const
 
int indexOf (QGraphicsLayoutItem *item) const
 
void insertItem (QGridLayoutItem *item, int index)
 The index is only used by QGraphicsLinearLayout to ensure that itemAt() reflects the order of visual arrangement. More...
 
void insertRow (int row, Qt::Orientation orientation=Qt::Vertical)
 
void invalidate ()
 
QGridLayoutItemitemAt (int index) const
 
QGridLayoutItemitemAt (int row, int column, Qt::Orientation orientation=Qt::Vertical) const
 
int itemCount () const
 
 QGridLayoutEngine ()
 
void removeItem (QGridLayoutItem *item)
 
void removeRows (int row, int count, Qt::Orientation orientation)
 
Qt::Alignment rowAlignment (int row, Qt::Orientation orientation) const
 
int rowCount (Qt::Orientation orientation) const
 
int rowCount () const
 
qreal rowSizeHint (Qt::SizeHint which, int row, Qt::Orientation orientation=Qt::Vertical) const
 
qreal rowSpacing (int row, Qt::Orientation orientation=Qt::Vertical) const
 
int rowStretchFactor (int row, Qt::Orientation orientation=Qt::Vertical) const
 
void setAlignment (QGraphicsLayoutItem *layoutItem, Qt::Alignment alignment)
 
void setGeometries (const QLayoutStyleInfo &styleInfo, const QRectF &contentsGeometry)
 
void setRowAlignment (int row, Qt::Alignment alignment, Qt::Orientation orientation)
 
void setRowSizeHint (Qt::SizeHint which, int row, qreal size, Qt::Orientation orientation=Qt::Vertical)
 
void setRowSpacing (int row, qreal spacing, Qt::Orientation orientation=Qt::Vertical)
 
void setRowStretchFactor (int row, int stretch, Qt::Orientation orientation=Qt::Vertical)
 
void setSpacing (qreal spacing, Qt::Orientations orientations)
 
void setStretchFactor (QGraphicsLayoutItem *layoutItem, int stretch, Qt::Orientation orientation)
 
void setVisualDirection (Qt::LayoutDirection direction)
 
QSizeF sizeHint (const QLayoutStyleInfo &styleInfo, Qt::SizeHint which, const QSizeF &constraint) const
 
qreal spacing (const QLayoutStyleInfo &styleInfo, Qt::Orientation orientation) const
 
int stretchFactor (QGraphicsLayoutItem *layoutItem, Qt::Orientation orientation) const
 
void transpose ()
 
Qt::LayoutDirection visualDirection () const
 
 ~QGridLayoutEngine ()
 

Private Functions

void ensureColumnAndRowData (QGridLayoutRowData *rowData, QGridLayoutBox *totalBox, const QLayoutStyleInfo &styleInfo, qreal *colPositions, qreal *colSizes, Qt::Orientation orientation) const
 
void ensureEffectiveFirstAndLastRows () const
 
void ensureGeometries (const QLayoutStyleInfo &styleInfo, const QSizeF &size) const
 
void fillRowData (QGridLayoutRowData *rowData, const QLayoutStyleInfo &styleInfo, qreal *colPositions, qreal *colSizes, Qt::Orientation orientation=Qt::Vertical) const
 
void insertOrRemoveRows (int row, int delta, Qt::Orientation orientation=Qt::Vertical)
 
int internalGridColumnCount () const
 
int internalGridRowCount () const
 
void maybeExpandGrid (int row, int column, Qt::Orientation orientation=Qt::Vertical)
 
void regenerateGrid ()
 
void setItemAt (int row, int column, QGridLayoutItem *item)
 

Static Private Functions

static int grossRoundUp (int n)
 

Properties

Qt::LayoutDirection m_visualDirection
 
quint8 q_cachedConstraintOrientation: 3
 
QLayoutStyleInfo q_cachedDataForStyleInfo
 
int q_cachedEffectiveFirstRows [NOrientations]
 
int q_cachedEffectiveLastRows [NOrientations]
 
QSizeF q_cachedSize
 
QGridLayoutRowData q_columnData
 
QLayoutParameter< qrealq_defaultSpacings [NOrientations]
 
QVector< qrealq_descents
 
QVector< QGridLayoutItem * > q_grid
 
QVector< qrealq_heights
 
QGridLayoutRowInfo q_infos [NOrientations]
 
QList< QGridLayoutItem * > q_items
 
QGridLayoutRowData q_rowData
 
QGridLayoutBox q_totalBoxes [NOrientations]
 
QVector< qrealq_widths
 
QVector< qrealq_xx
 
QVector< qrealq_yy
 

Friends

class QGridLayoutItem
 

Detailed Description

Definition at line 331 of file qgridlayoutengine_p.h.

Constructors and Destructors

◆ QGridLayoutEngine()

QGridLayoutEngine::QGridLayoutEngine ( )

Definition at line 803 of file qgridlayoutengine.cpp.

804 {
806  invalidate();
807 }
Qt::LayoutDirection m_visualDirection

◆ ~QGridLayoutEngine()

QGridLayoutEngine::~QGridLayoutEngine ( )
inline

Definition at line 335 of file qgridlayoutengine_p.h.

335 { qDeleteAll(q_items); }
QList< QGridLayoutItem * > q_items
Q_OUTOFLINE_TEMPLATE void qDeleteAll(ForwardIterator begin, ForwardIterator end)
Definition: qalgorithms.h:319

Functions

◆ addItem()

void QGridLayoutEngine::addItem ( QGridLayoutItem item)

Definition at line 1029 of file qgridlayoutengine.cpp.

1030 {
1031  insertItem(item, -1);
1032 }
void insertItem(QGridLayoutItem *item, int index)
The index is only used by QGraphicsLinearLayout to ensure that itemAt() reflects the order of visual ...

◆ alignment()

Qt::Alignment QGridLayoutEngine::alignment ( QGraphicsLayoutItem layoutItem) const

Definition at line 979 of file qgridlayoutengine.cpp.

980 {
981  if (QGridLayoutItem *item = findLayoutItem(layoutItem))
982  return item->alignment();
983  return 0;
984 }
QGridLayoutItem * findLayoutItem(QGraphicsLayoutItem *layoutItem) const

◆ cellRect()

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

Definition at line 1115 of file qgridlayoutengine.cpp.

1118 {
1119  if (uint(row) >= uint(rowCount()) || uint(column) >= uint(columnCount())
1120  || rowSpan < 1 || columnSpan < 1)
1121  return QRectF();
1122 
1123  ensureGeometries(styleInfo, contentsGeometry.size());
1124 
1125  int lastColumn = qMax(column + columnSpan, columnCount()) - 1;
1126  int lastRow = qMax(row + rowSpan, rowCount()) - 1;
1127 
1128  qreal x = q_xx[column];
1129  qreal y = q_yy[row];
1130  qreal width = q_widths[lastColumn];
1131  qreal height = q_heights[lastRow];
1132 
1133  if (columnSpan != 1)
1134  width += q_xx[lastColumn] - x;
1135  if (rowSpan != 1)
1136  height += q_yy[lastRow] - y;
1137 
1138  return QRectF(contentsGeometry.x() + x, contentsGeometry.y() + y, width, height);
1139 }
qreal y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:667
double qreal
Definition: qglobal.h:1193
QVector< qreal > q_yy
void ensureGeometries(const QLayoutStyleInfo &styleInfo, const QSizeF &size) const
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
QVector< qreal > q_xx
unsigned int uint
Definition: qglobal.h:996
qreal x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:664
QVector< qreal > q_heights
QVector< qreal > q_widths
QSizeF size() const
Returns the size of the rectangle.
Definition: qrect.h:713

◆ columnCount() [1/2]

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

Definition at line 814 of file qgridlayoutengine.cpp.

Referenced by QGraphicsLinearLayoutPrivate::gridColumn().

815 {
816  return q_infos[orientation == Qt::Horizontal].count;
817 }
QGridLayoutRowInfo q_infos[NOrientations]

◆ columnCount() [2/2]

int QGridLayoutEngine::columnCount ( ) const
inline

Definition at line 340 of file qgridlayoutengine_p.h.

340 { return q_infos[Hor].count; }
QGridLayoutRowInfo q_infos[NOrientations]

◆ constraintOrientation()

Qt::Orientation QGridLayoutEngine::constraintOrientation ( ) const

Definition at line 1699 of file qgridlayoutengine.cpp.

1700 {
1701  (void)ensureDynamicConstraint();
1703 }
bool ensureDynamicConstraint() const
Orientation
Definition: qnamespace.h:174

◆ controlTypes()

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

Definition at line 1215 of file qgridlayoutengine.cpp.

1216 {
1217  Qt::Orientation orientation = (side == Top || side == Bottom) ? Qt::Vertical : Qt::Horizontal;
1218  int row = (side == Top || side == Left) ? effectiveFirstRow(orientation)
1219  : effectiveLastRow(orientation);
1220  QSizePolicy::ControlTypes result = 0;
1221 
1222  for (int column = columnCount(orientation) - 1; column >= 0; --column) {
1223  if (QGridLayoutItem *item = itemAt(row, column, orientation))
1224  result |= item->controlTypes(side);
1225  }
1226  return result;
1227 }
int effectiveFirstRow(Qt::Orientation orientation=Qt::Vertical) const
int effectiveLastRow(Qt::Orientation orientation=Qt::Vertical) const
QGridLayoutItem * itemAt(int index) const
Orientation
Definition: qnamespace.h:174

◆ dump()

void QGridLayoutEngine::dump ( int  indent = 0) const

Definition at line 1253 of file qgridlayoutengine.cpp.

1254 {
1255  qDebug("%*sEngine", indent, "");
1256 
1257  qDebug("%*s Items (%d)", indent, "", q_items.count());
1258  int i;
1259  for (i = 0; i < q_items.count(); ++i)
1260  q_items.at(i)->dump(indent + 2);
1261 
1262  qDebug("%*s Grid (%d x %d)", indent, "", internalGridRowCount(),
1264  for (int row = 0; row < internalGridRowCount(); ++row) {
1265  QString message = QLatin1String("[ ");
1266  for (int column = 0; column < internalGridColumnCount(); ++column) {
1267  message += QString::number(q_items.indexOf(itemAt(row, column))).rightJustified(3);
1268  message += QLatin1Char(' ');
1269  }
1270  message += QLatin1Char(']');
1271  qDebug("%*s %s", indent, "", qPrintable(message));
1272  }
1273 
1274  if (q_defaultSpacings[Hor].value() >= 0.0 || q_defaultSpacings[Ver].value() >= 0.0)
1275  qDebug("%*s Default spacings: %g %g", indent, "", q_defaultSpacings[Hor].value(),
1276  q_defaultSpacings[Ver].value());
1277 
1278  qDebug("%*s Column and row info", indent, "");
1279  q_infos[Hor].dump(indent + 2);
1280  q_infos[Ver].dump(indent + 2);
1281 
1282  qDebug("%*s Column and row data", indent, "");
1283  q_columnData.dump(indent + 2);
1284  q_rowData.dump(indent + 2);
1285 
1286  qDebug("%*s Geometries output", indent, "");
1287  QVector<qreal> *cellPos = &q_yy;
1288  for (int pass = 0; pass < 2; ++pass) {
1289  QString message;
1290  for (i = 0; i < cellPos->count(); ++i) {
1291  message += QLatin1String((message.isEmpty() ? "[" : ", "));
1292  message += QString::number(cellPos->at(i));
1293  }
1294  message += QLatin1Char(']');
1295  qDebug("%*s %s %s", indent, "", (pass == 0 ? "rows:" : "columns:"), qPrintable(message));
1296  cellPos = &q_xx;
1297  }
1298 }
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qstring.cpp:6448
QGridLayoutRowData q_columnData
QList< QGridLayoutItem * > q_items
int count(const T &t) const
Returns the number of occurrences of value in the vector.
Definition: qvector.h:742
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
void dump(int indent=0) const
The QString class provides a Unicode character string.
Definition: qstring.h:83
int internalGridColumnCount() const
QVector< qreal > q_yy
Q_CORE_EXPORT void qDebug(const char *,...)
QGridLayoutRowData q_rowData
QVector< qreal > q_xx
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
QGridLayoutRowInfo q_infos[NOrientations]
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
const T & at(int i) const
Returns the item at index position i in the vector.
Definition: qvector.h:350
void dump(int indent=0) const
void dump(int indent=0) const
QGridLayoutItem * itemAt(int index) const
int indexOf(const T &t, int from=0) const
Returns the index position of the first occurrence of value in the list, searching forward from index...
Definition: qlist.h:847
int internalGridRowCount() const
#define qPrintable(string)
Definition: qglobal.h:1750
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55
QLayoutParameter< qreal > q_defaultSpacings[NOrientations]

◆ dynamicallyConstrainedSizeHint()

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

◆ effectiveAlignment()

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

Definition at line 986 of file qgridlayoutengine.cpp.

Referenced by QGridLayoutItem::geometryWithin().

987 {
988  Qt::Alignment align = layoutItem->alignment();
989  if (!(align & Qt::AlignVertical_Mask)) {
990  // no vertical alignment, respect the row alignment
991  int y = layoutItem->firstRow();
993  }
994  if (!(align & Qt::AlignHorizontal_Mask)) {
995  // no horizontal alignment, respect the column alignment
996  int x = layoutItem->firstColumn();
998  }
999  return align;
1000 }
Qt::Alignment alignment() const
Qt::Alignment rowAlignment(int row, Qt::Orientation orientation) const

◆ effectiveFirstRow()

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

Definition at line 839 of file qgridlayoutengine.cpp.

840 {
842  return q_cachedEffectiveFirstRows[orientation == Qt::Vertical];
843 }
void ensureEffectiveFirstAndLastRows() const
int q_cachedEffectiveFirstRows[NOrientations]

◆ effectiveLastRow()

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

Definition at line 845 of file qgridlayoutengine.cpp.

846 {
848  return q_cachedEffectiveLastRows[orientation == Qt::Vertical];
849 }
int q_cachedEffectiveLastRows[NOrientations]
void ensureEffectiveFirstAndLastRows() const

◆ ensureColumnAndRowData()

void QGridLayoutEngine::ensureColumnAndRowData ( QGridLayoutRowData rowData,
QGridLayoutBox totalBox,
const QLayoutStyleInfo styleInfo,
qreal colPositions,
qreal colSizes,
Qt::Orientation  orientation 
) const
private

Definition at line 1649 of file qgridlayoutengine.cpp.

1653 {
1654  rowData->reset(rowCount(orientation));
1655  fillRowData(rowData, styleInfo, colPositions, colSizes, orientation);
1656  const QGridLayoutRowInfo &rowInfo = q_infos[orientation == Qt::Vertical];
1657  rowData->distributeMultiCells(rowInfo);
1658  *totalBox = rowData->totalBox(0, rowCount(orientation));
1659  //We have items whose width depends on their height
1660 }
void distributeMultiCells(const QGridLayoutRowInfo &rowInfo)
void fillRowData(QGridLayoutRowData *rowData, const QLayoutStyleInfo &styleInfo, qreal *colPositions, qreal *colSizes, Qt::Orientation orientation=Qt::Vertical) const
QGridLayoutRowInfo q_infos[NOrientations]
QGridLayoutBox totalBox(int start, int end) const

◆ 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 1666 of file qgridlayoutengine.cpp.

1667 {
1669  for (int i = q_items.count() - 1; i >= 0; --i) {
1670  QGridLayoutItem *item = q_items.at(i);
1671  if (item->hasDynamicConstraint()) {
1672  Qt::Orientation itemConstraintOrientation = item->dynamicConstraintOrientation();
1674  q_cachedConstraintOrientation = itemConstraintOrientation;
1675  } else if (q_cachedConstraintOrientation != itemConstraintOrientation) {
1677  qWarning("QGridLayoutEngine: Unfeasible, cannot mix horizontal and"
1678  " vertical constraint in the same layout");
1679  return false;
1680  }
1681  }
1682  }
1685  }
1686  return true;
1687 }
QList< QGridLayoutItem * > q_items
Qt::Orientation dynamicConstraintOrientation() const
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
bool hasDynamicConstraint() const
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
Q_CORE_EXPORT void qWarning(const char *,...)
Orientation
Definition: qnamespace.h:174

◆ ensureEffectiveFirstAndLastRows()

void QGridLayoutEngine::ensureEffectiveFirstAndLastRows ( ) const
private

Definition at line 1624 of file qgridlayoutengine.cpp.

1625 {
1626  if (q_cachedEffectiveFirstRows[Hor] == -1 && !q_items.isEmpty()) {
1627  int rowCount = this->rowCount();
1628  int columnCount = this->columnCount();
1629 
1634 
1635  for (int i = q_items.count() - 1; i >= 0; --i) {
1636  const QGridLayoutItem *item = q_items.at(i);
1637 
1638  for (int j = 0; j < NOrientations; ++j) {
1639  Qt::Orientation orientation = (j == Hor) ? Qt::Horizontal : Qt::Vertical;
1640  if (item->firstRow(orientation) < q_cachedEffectiveFirstRows[j])
1641  q_cachedEffectiveFirstRows[j] = item->firstRow(orientation);
1642  if (item->lastRow(orientation) > q_cachedEffectiveLastRows[j])
1643  q_cachedEffectiveLastRows[j] = item->lastRow(orientation);
1644  }
1645  }
1646  }
1647 }
int q_cachedEffectiveLastRows[NOrientations]
QList< QGridLayoutItem * > q_items
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
int q_cachedEffectiveFirstRows[NOrientations]
Orientation
Definition: qnamespace.h:174

◆ ensureGeometries()

void QGridLayoutEngine::ensureGeometries ( const QLayoutStyleInfo styleInfo,
const QSizeF size 
) const
private

Definition at line 1705 of file qgridlayoutengine.cpp.

1707 {
1708  if (q_cachedDataForStyleInfo == styleInfo && q_cachedSize == size)
1709  return;
1710 
1711  q_cachedDataForStyleInfo = styleInfo;
1712  q_cachedSize = size;
1713 
1714  q_xx.resize(columnCount());
1716  q_yy.resize(rowCount());
1719 
1721  //We might have items whose width depends on their height
1722  ensureColumnAndRowData(&q_columnData, &q_totalBoxes[Hor], styleInfo, NULL, NULL, Qt::Horizontal);
1723  //Calculate column widths and positions, and put results in q_xx.data() and q_widths.data() so that we can use this information as
1724  //constraints to find the row heights
1726  0, q_totalBoxes[Hor], q_infos[Hor] );
1728  //Calculate row heights and positions, and put results in q_yy.data() and q_heights.data()
1731  } else {
1732  //We have items whose height depends on their width
1733  ensureColumnAndRowData(&q_rowData, &q_totalBoxes[Ver], styleInfo, NULL, NULL, Qt::Vertical);
1734  //Calculate row heights and positions, and put results in q_yy.data() and q_heights.data() so that we can use this information as
1735  //constraints to find the column widths
1739  //Calculate row heights and positions, and put results in q_yy.data() and q_heights.data()
1741  0, q_totalBoxes[Hor], q_infos[Hor]);
1742  }
1743 }
QGridLayoutRowData q_columnData
QVector< qreal > q_descents
qreal width() const
Returns the width.
Definition: qsize.h:284
qreal height() const
Returns the height.
Definition: qsize.h:287
QGridLayoutBox q_totalBoxes[NOrientations]
QVector< qreal > q_yy
void resize(int size)
Sets the size of the vector to size.
Definition: qvector.h:342
QGridLayoutRowData q_rowData
QVector< qreal > q_xx
QGridLayoutRowInfo q_infos[NOrientations]
void ensureColumnAndRowData(QGridLayoutRowData *rowData, QGridLayoutBox *totalBox, const QLayoutStyleInfo &styleInfo, qreal *colPositions, qreal *colSizes, Qt::Orientation orientation) const
Qt::Orientation constraintOrientation() const
QVector< qreal > q_heights
QVector< qreal > q_widths
T * data()
Returns a pointer to the data stored in the vector.
Definition: qvector.h:152
void calculateGeometries(int start, int end, qreal targetSize, qreal *positions, qreal *sizes, qreal *descents, const QGridLayoutBox &totalBox, const QGridLayoutRowInfo &rowInfo)
QLayoutStyleInfo q_cachedDataForStyleInfo

◆ fillRowData()

void QGridLayoutEngine::fillRowData ( QGridLayoutRowData rowData,
const QLayoutStyleInfo styleInfo,
qreal colPositions,
qreal colSizes,
Qt::Orientation  orientation = Qt::Vertical 
) const
private

Definition at line 1383 of file qgridlayoutengine.cpp.

1386 {
1388  const QGridLayoutRowInfo &rowInfo = q_infos[orientation == Qt::Vertical];
1389  const QGridLayoutRowInfo &columnInfo = q_infos[orientation == Qt::Horizontal];
1390  LayoutSide top = (orientation == Qt::Vertical) ? Top : Left;
1391  LayoutSide bottom = (orientation == Qt::Vertical) ? Bottom : Right;
1392 
1393  QStyle *style = styleInfo.style();
1394  QStyleOption option;
1395  option.initFrom(styleInfo.widget());
1396 
1397  const QLayoutParameter<qreal> &defaultSpacing = q_defaultSpacings[orientation == Qt::Vertical];
1398  qreal innerSpacing = 0.0;
1399  if (style)
1400  innerSpacing = (qreal)style->pixelMetric(orientation == Qt::Vertical ? QStyle::PM_LayoutVerticalSpacing
1402  &option, styleInfo.widget());
1403  if (innerSpacing >= 0.0)
1404  defaultSpacing.setCachedValue(innerSpacing);
1405 
1406  for (int row = 0; row < rowInfo.count; ++row) {
1407  bool rowIsEmpty = true;
1408  bool rowIsIdenticalToPrevious = (row > 0);
1409 
1410  for (int column = 0; column < columnInfo.count; ++column) {
1411  QGridLayoutItem *item = itemAt(row, column, orientation);
1412 
1413  if (rowIsIdenticalToPrevious && item != itemAt(row - 1, column, orientation))
1414  rowIsIdenticalToPrevious = false;
1415 
1416  if (item)
1417  rowIsEmpty = false;
1418  }
1419 
1420  if ((rowIsEmpty || rowIsIdenticalToPrevious)
1421  && rowInfo.spacings.value(row).isDefault()
1422  && rowInfo.stretches.value(row).isDefault()
1423  && rowInfo.boxes.value(row) == QGridLayoutBox())
1424  rowData->ignore.setBit(row, true);
1425 
1426  if (rowInfo.spacings.value(row).isUser()) {
1427  rowData->spacings[row] = rowInfo.spacings.at(row).value();
1428  } else if (!defaultSpacing.isDefault()) {
1429  rowData->spacings[row] = defaultSpacing.value();
1430  }
1431 
1432  rowData->stretches[row] = rowInfo.stretches.value(row).value();
1433  }
1434 
1435  struct RowAdHocData {
1436  int q_row;
1437  unsigned int q_hasButtons : 8;
1438  unsigned int q_hasNonButtons : 8;
1439 
1440  inline RowAdHocData() : q_row(-1), q_hasButtons(false), q_hasNonButtons(false) {}
1441  inline void init(int row) {
1442  this->q_row = row;
1443  q_hasButtons = false;
1444  q_hasNonButtons = false;
1445  }
1446  inline bool hasOnlyButtons() const { return q_hasButtons && !q_hasNonButtons; }
1447  inline bool hasOnlyNonButtons() const { return q_hasNonButtons && !q_hasButtons; }
1448  };
1449  RowAdHocData lastRowAdHocData;
1450  RowAdHocData nextToLastRowAdHocData;
1451  RowAdHocData nextToNextToLastRowAdHocData;
1452 
1453  rowData->hasIgnoreFlag = false;
1454  for (int row = 0; row < rowInfo.count; ++row) {
1455  if (rowData->ignore.testBit(row))
1456  continue;
1457 
1458  QGridLayoutBox &rowBox = rowData->boxes[row];
1459  if (option.state & QStyle::State_Window) {
1460  nextToNextToLastRowAdHocData = nextToLastRowAdHocData;
1461  nextToLastRowAdHocData = lastRowAdHocData;
1462  lastRowAdHocData.init(row);
1463  }
1464 
1465  bool userRowStretch = rowInfo.stretches.value(row).isUser();
1466  int &rowStretch = rowData->stretches[row];
1467 
1468  bool hasIgnoreFlag = true;
1469  for (int column = 0; column < columnInfo.count; ++column) {
1470  QGridLayoutItem *item = itemAt(row, column, orientation);
1471  if (item) {
1472  int itemRow = item->firstRow(orientation);
1473  int itemColumn = item->firstColumn(orientation);
1474 
1475  if (itemRow == row && itemColumn == column) {
1476  int itemStretch = item->stretchFactor(orientation);
1477  if (!(item->sizePolicy(orientation) & QSizePolicy::IgnoreFlag))
1478  hasIgnoreFlag = false;
1479  int itemRowSpan = item->rowSpan(orientation);
1480 
1481  int effectiveRowSpan = 1;
1482  for (int i = 1; i < itemRowSpan; ++i) {
1483  if (!rowData->ignore.testBit(i + itemRow))
1484  ++effectiveRowSpan;
1485  }
1486 
1487  QGridLayoutBox *box;
1488  if (effectiveRowSpan == 1) {
1489  box = &rowBox;
1490  if (!userRowStretch && itemStretch != 0)
1491  rowStretch = qMax(rowStretch, itemStretch);
1492  } else {
1493  QGridLayoutMultiCellData &multiCell =
1494  rowData->multiCellMap[qMakePair(row, effectiveRowSpan)];
1495  box = &multiCell.q_box;
1496  multiCell.q_stretch = itemStretch;
1497  }
1498  // Items with constraints need to be passed the constraint
1499  if (colSizes && colPositions && item->hasDynamicConstraint() && orientation == item->dynamicConstraintOrientation()) {
1500  /* Get the width of the item by summing up the widths of the columns that it spans.
1501  * We need to have already calculated the widths of the columns by calling
1502  * q_columns->calculateGeometries() before hand and passing the value in the colSizes
1503  * and colPositions parameters.
1504  * The variable name is still colSizes even when it actually has the row sizes
1505  */
1506  qreal length = colSizes[item->lastColumn(orientation)];
1507  if (item->columnSpan(orientation) != 1)
1508  length += colPositions[item->lastColumn(orientation)] - colPositions[item->firstColumn(orientation)];
1509  box->combine(item->box(orientation, length));
1510  } else {
1511  box->combine(item->box(orientation));
1512  }
1513 
1514  if (effectiveRowSpan == 1) {
1515  QSizePolicy::ControlTypes controls = item->controlTypes(top);
1516  if (controls & ButtonMask)
1517  lastRowAdHocData.q_hasButtons = true;
1518  if (controls & ~ButtonMask)
1519  lastRowAdHocData.q_hasNonButtons = true;
1520  }
1521  }
1522  }
1523  }
1524  if (row < rowInfo.boxes.count()) {
1525  QGridLayoutBox rowBoxInfo = rowInfo.boxes.at(row);
1526  rowBoxInfo.normalize();
1527  rowBox.q_minimumSize = qMax(rowBox.q_minimumSize, rowBoxInfo.q_minimumSize);
1528  rowBox.q_maximumSize = qMax(rowBox.q_minimumSize,
1529  (rowBoxInfo.q_maximumSize != FLT_MAX ?
1530  rowBoxInfo.q_maximumSize : rowBox.q_maximumSize));
1531  rowBox.q_preferredSize = qBound(rowBox.q_minimumSize,
1532  qMax(rowBox.q_preferredSize, rowBoxInfo.q_preferredSize),
1533  rowBox.q_maximumSize);
1534  }
1535  if (hasIgnoreFlag)
1536  rowData->hasIgnoreFlag = true;
1537  }
1538 
1539  /*
1540  Heuristic: Detect button boxes that don't use QSizePolicy::ButtonBox.
1541  This is somewhat ad hoc but it usually does the trick.
1542  */
1543  bool lastRowIsButtonBox = (lastRowAdHocData.hasOnlyButtons()
1544  && nextToLastRowAdHocData.hasOnlyNonButtons());
1545  bool lastTwoRowsIsButtonBox = (lastRowAdHocData.hasOnlyButtons()
1546  && nextToLastRowAdHocData.hasOnlyButtons()
1547  && nextToNextToLastRowAdHocData.hasOnlyNonButtons()
1548  && orientation == Qt::Vertical);
1549 
1550  if (defaultSpacing.isDefault()) {
1551  int prevRow = -1;
1552  for (int row = 0; row < rowInfo.count; ++row) {
1553  if (rowData->ignore.testBit(row))
1554  continue;
1555 
1556  if (prevRow != -1 && !rowInfo.spacings.value(prevRow).isUser()) {
1557  qreal &rowSpacing = rowData->spacings[prevRow];
1558  for (int column = 0; column < columnInfo.count; ++column) {
1559  QGridLayoutItem *item1 = itemAt(prevRow, column, orientation);
1560  QGridLayoutItem *item2 = itemAt(row, column, orientation);
1561 
1562  if (item1 && item2 && item1 != item2) {
1563  QSizePolicy::ControlTypes controls1 = item1->controlTypes(bottom);
1564  QSizePolicy::ControlTypes controls2 = item2->controlTypes(top);
1565 
1566  if (controls2 & QSizePolicy::PushButton) {
1567  if ((row == nextToLastRowAdHocData.q_row && lastTwoRowsIsButtonBox)
1568  || (row == lastRowAdHocData.q_row && lastRowIsButtonBox)) {
1569  controls2 &= ~QSizePolicy::PushButton;
1570  controls2 |= QSizePolicy::ButtonBox;
1571  }
1572  }
1573 
1574  qreal spacing = style->combinedLayoutSpacing(controls1, controls2,
1575  orientation, &option,
1576  styleInfo.widget());
1577  if (orientation == Qt::Horizontal) {
1578  qreal width1 = rowData->boxes.at(prevRow).q_minimumSize;
1579  qreal width2 = rowData->boxes.at(row).q_minimumSize;
1580  QRectF rect1 = item1->geometryWithin(0.0, 0.0, width1, FLT_MAX, -1.0);
1581  QRectF rect2 = item2->geometryWithin(0.0, 0.0, width2, FLT_MAX, -1.0);
1582  spacing -= (width1 - (rect1.x() + rect1.width())) + rect2.x();
1583  } else {
1584  const QGridLayoutBox &box1 = rowData->boxes.at(prevRow);
1585  const QGridLayoutBox &box2 = rowData->boxes.at(row);
1586  qreal height1 = box1.q_minimumSize;
1587  qreal height2 = box2.q_minimumSize;
1588  qreal rowDescent1 = fixedDescent(box1.q_minimumDescent,
1589  box1.q_minimumAscent, height1);
1590  qreal rowDescent2 = fixedDescent(box2.q_minimumDescent,
1591  box2.q_minimumAscent, height2);
1592  QRectF rect1 = item1->geometryWithin(0.0, 0.0, FLT_MAX, height1,
1593  rowDescent1);
1594  QRectF rect2 = item2->geometryWithin(0.0, 0.0, FLT_MAX, height2,
1595  rowDescent2);
1596  spacing -= (height1 - (rect1.y() + rect1.height())) + rect2.y();
1597  }
1598  rowSpacing = qMax(spacing, rowSpacing);
1599  }
1600  }
1601  }
1602  prevRow = row;
1603  }
1604  } else if (lastRowIsButtonBox || lastTwoRowsIsButtonBox) {
1605  /*
1606  Even for styles that define a uniform spacing, we cheat a
1607  bit and use the window margin as the spacing. This
1608  significantly improves the look of dialogs.
1609  */
1610  int prevRow = lastRowIsButtonBox ? nextToLastRowAdHocData.q_row
1611  : nextToNextToLastRowAdHocData.q_row;
1612  if (!defaultSpacing.isUser() && !rowInfo.spacings.value(prevRow).isUser()) {
1613  qreal windowMargin = style->pixelMetric(orientation == Qt::Vertical
1616  &option, styleInfo.widget());
1617 
1618  qreal &rowSpacing = rowData->spacings[prevRow];
1619  rowSpacing = qMax(windowMargin, rowSpacing);
1620  }
1621  }
1622 }
void setCachedValue(T value) const
qreal y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:667
double qreal
Definition: qglobal.h:1193
void setBit(int i)
Sets the bit at index position i to 1.
Definition: qbitarray.h:128
Qt::Orientation dynamicConstraintOrientation() const
QStyle::State state
the style flags that are used when drawing the control
Definition: qstyleoption.h:88
int count(const T &t) const
Returns the number of occurrences of value in the vector.
Definition: qvector.h:742
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option=0, const QWidget *widget=0) const =0
Returns the value of the given pixel metric.
bool hasDynamicConstraint() const
bool testBit(int i) const
Returns true if the bit at index position i is 1; otherwise returns false.
Definition: qbitarray.h:124
QRectF geometryWithin(qreal x, qreal y, qreal width, qreal height, qreal rowDescent) const
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
QSizePolicy::Policy sizePolicy(Qt::Orientation orientation) const
QStyle * style() const
QVector< QGridLayoutBox > boxes
QVector< QStretchParameter > stretches
The QStyleOption class stores the parameters used by QStyle functions.
Definition: qstyleoption.h:67
QGridLayoutRowInfo q_infos[NOrientations]
T value(int i) const
Returns the value at index position i in the vector.
Definition: qvector.h:559
static bool init
void initFrom(const QWidget *w)
Definition: qstyleoption.h:99
qreal height() const
Returns the height of the rectangle.
Definition: qrect.h:710
QVector< int > stretches
qreal spacing(const QLayoutStyleInfo &styleInfo, Qt::Orientation orientation) const
qreal width() const
Returns the width of the rectangle.
Definition: qrect.h:707
QVector< QLayoutParameter< qreal > > spacings
const T & at(int i) const
Returns the item at index position i in the vector.
Definition: qvector.h:350
QVector< qreal > spacings
static qreal fixedDescent(qreal descent, qreal ascent, qreal targetSize)
QGridLayoutItem * itemAt(int index) const
QWidget * widget() const
qreal x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:664
QGridLayoutBox box(Qt::Orientation orientation, qreal constraint=-1.0) const
Q_OUTOFLINE_TEMPLATE QPair< T1, T2 > qMakePair(const T1 &x, const T2 &y)
Definition: qpair.h:102
Q_DECL_CONSTEXPR const T & qBound(const T &min, const T &val, const T &max)
Definition: qglobal.h:1219
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI...
Definition: qstyle.h:68
void combine(const QGridLayoutBox &other)
QSizePolicy::ControlTypes controlTypes(LayoutSide side) const
QVector< QGridLayoutBox > boxes
qreal rowSpacing(int row, Qt::Orientation orientation=Qt::Vertical) const
int combinedLayoutSpacing(QSizePolicy::ControlTypes controls1, QSizePolicy::ControlTypes controls2, Qt::Orientation orientation, QStyleOption *option=0, QWidget *widget=0) const
Returns the spacing that should be used between controls1 and controls2 in a layout.
Definition: qstyle.cpp:2438
QLayoutParameter< qreal > q_defaultSpacings[NOrientations]
int stretchFactor(Qt::Orientation orientation) const

◆ findLayoutItem()

QGridLayoutItem * QGridLayoutEngine::findLayoutItem ( QGraphicsLayoutItem layoutItem) const

Definition at line 1050 of file qgridlayoutengine.cpp.

1051 {
1052  for (int i = q_items.count() - 1; i >= 0; --i) {
1053  QGridLayoutItem *item = q_items.at(i);
1054  if (item->layoutItem() == layoutItem)
1055  return item;
1056  }
1057  return 0;
1058 }
QList< QGridLayoutItem * > q_items
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QGraphicsLayoutItem * layoutItem() const

◆ grossRoundUp()

static int QGridLayoutEngine::grossRoundUp ( int  n)
inlinestaticprivate

Definition at line 408 of file qgridlayoutengine_p.h.

408 { return ((n + 2) | 0x3) - 2; }

◆ hasDynamicConstraint()

bool QGridLayoutEngine::hasDynamicConstraint ( ) const

Definition at line 1689 of file qgridlayoutengine.cpp.

1690 {
1691  if (!ensureDynamicConstraint())
1692  return false;
1694 }
bool ensureDynamicConstraint() const

◆ indexOf()

int QGridLayoutEngine::indexOf ( QGraphicsLayoutItem item) const

Definition at line 830 of file qgridlayoutengine.cpp.

831 {
832  for (int i = 0; i < q_items.size(); ++i) {
833  if (item == q_items.at(i)->layoutItem())
834  return i;
835  }
836  return -1;
837 }
QList< QGridLayoutItem * > q_items
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QGraphicsLayoutItem * layoutItem() const
int size() const
Returns the number of items in the list.
Definition: qlist.h:137

◆ 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.

Warning
This function is not part of the public interface. 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 1011 of file qgridlayoutengine.cpp.

Referenced by QGridLayoutItem::QGridLayoutItem().

1012 {
1013  maybeExpandGrid(item->lastRow(), item->lastColumn());
1014 
1015  if (index == -1)
1016  q_items.append(item);
1017  else
1018  q_items.insert(index, item);
1019 
1020  for (int i = item->firstRow(); i <= item->lastRow(); ++i) {
1021  for (int j = item->firstColumn(); j <= item->lastColumn(); ++j) {
1022  if (itemAt(i, j))
1023  qWarning("QGridLayoutEngine::addItem: Cell (%d, %d) already taken", i, j);
1024  setItemAt(i, j, item);
1025  }
1026  }
1027 }
QList< QGridLayoutItem * > q_items
void insert(int i, const T &t)
Inserts value at index position i in the list.
Definition: qlist.h:575
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
Q_CORE_EXPORT void qWarning(const char *,...)
QGridLayoutItem * itemAt(int index) const
void setItemAt(int row, int column, QGridLayoutItem *item)
quint16 index
void maybeExpandGrid(int row, int column, Qt::Orientation orientation=Qt::Vertical)

◆ insertOrRemoveRows()

void QGridLayoutEngine::insertOrRemoveRows ( int  row,
int  delta,
Qt::Orientation  orientation = Qt::Vertical 
)
private

Definition at line 1361 of file qgridlayoutengine.cpp.

1362 {
1363  int oldRowCount = rowCount(orientation);
1364  Q_ASSERT(uint(row) <= uint(oldRowCount));
1365 
1366  invalidate();
1367 
1368  // appending rows (or columns) is easy
1369  if (row == oldRowCount && delta > 0) {
1370  maybeExpandGrid(oldRowCount + delta - 1, -1, orientation);
1371  return;
1372  }
1373 
1374  q_infos[orientation == Qt::Vertical].insertOrRemoveRows(row, delta);
1375 
1376  for (int i = q_items.count() - 1; i >= 0; --i)
1377  q_items.at(i)->insertOrRemoveRows(row, delta, orientation);
1378 
1380  regenerateGrid();
1381 }
QList< QGridLayoutItem * > q_items
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
int internalGridColumnCount() const
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
QVector< QGridLayoutItem * > q_grid
void resize(int size)
Sets the size of the vector to size.
Definition: qvector.h:342
void insertOrRemoveRows(int row, int delta)
QGridLayoutRowInfo q_infos[NOrientations]
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
unsigned int uint
Definition: qglobal.h:996
int internalGridRowCount() const
void insertOrRemoveRows(int row, int delta, Qt::Orientation orientation=Qt::Vertical)
void maybeExpandGrid(int row, int column, Qt::Orientation orientation=Qt::Vertical)

◆ insertRow()

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

Definition at line 380 of file qgridlayoutengine_p.h.

381  { insertOrRemoveRows(row, +1, orientation); }
void insertOrRemoveRows(int row, int delta, Qt::Orientation orientation=Qt::Vertical)

◆ internalGridColumnCount()

int QGridLayoutEngine::internalGridColumnCount ( ) const
inlineprivate

Definition at line 413 of file qgridlayoutengine_p.h.

413 { return grossRoundUp(columnCount()); }
static int grossRoundUp(int n)

◆ internalGridRowCount()

int QGridLayoutEngine::internalGridRowCount ( ) const
inlineprivate

Definition at line 412 of file qgridlayoutengine_p.h.

412 { return grossRoundUp(rowCount()); }
static int grossRoundUp(int n)

◆ invalidate()

void QGridLayoutEngine::invalidate ( )

Definition at line 1069 of file qgridlayoutengine.cpp.

1070 {
1076  q_cachedSize = QSizeF();
1078 }
int q_cachedEffectiveLastRows[NOrientations]
The QSizeF class defines the size of a two-dimensional object using floating point precision...
Definition: qsize.h:202
int q_cachedEffectiveFirstRows[NOrientations]
QLayoutStyleInfo q_cachedDataForStyleInfo

◆ itemAt() [1/2]

QGridLayoutItem * QGridLayoutEngine::itemAt ( int  index) const

Definition at line 824 of file qgridlayoutengine.cpp.

825 {
826  Q_ASSERT(index >= 0 && index < itemCount());
827  return q_items.at(index);
828 }
QList< QGridLayoutItem * > q_items
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
quint16 index

◆ itemAt() [2/2]

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

Definition at line 1060 of file qgridlayoutengine.cpp.

1061 {
1062  if (orientation == Qt::Horizontal)
1063  qSwap(row, column);
1064  if (uint(row) >= uint(rowCount()) || uint(column) >= uint(columnCount()))
1065  return 0;
1066  return q_grid.at((row * internalGridColumnCount()) + column);
1067 }
int internalGridColumnCount() const
QVector< QGridLayoutItem * > q_grid
unsigned int uint
Definition: qglobal.h:996
void qSwap(T &value1, T &value2)
Definition: qglobal.h:2181
const T & at(int i) const
Returns the item at index position i in the vector.
Definition: qvector.h:350

◆ itemCount()

int QGridLayoutEngine::itemCount ( ) const

Definition at line 819 of file qgridlayoutengine.cpp.

820 {
821  return q_items.count();
822 }
QList< QGridLayoutItem * > q_items
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891

◆ maybeExpandGrid()

void QGridLayoutEngine::maybeExpandGrid ( int  row,
int  column,
Qt::Orientation  orientation = Qt::Vertical 
)
private

Definition at line 1301 of file qgridlayoutengine.cpp.

1302 {
1303  invalidate(); // ### move out of here?
1304 
1305  if (orientation == Qt::Horizontal)
1306  qSwap(row, column);
1307 
1308  if (row < rowCount() && column < columnCount())
1309  return;
1310 
1311  int oldGridRowCount = internalGridRowCount();
1312  int oldGridColumnCount = internalGridColumnCount();
1313 
1314  q_infos[Ver].count = qMax(row + 1, rowCount());
1315  q_infos[Hor].count = qMax(column + 1, columnCount());
1316 
1317  int newGridRowCount = internalGridRowCount();
1318  int newGridColumnCount = internalGridColumnCount();
1319 
1320  int newGridSize = newGridRowCount * newGridColumnCount;
1321  if (newGridSize != q_grid.count()) {
1322  q_grid.resize(newGridSize);
1323 
1324  if (newGridColumnCount != oldGridColumnCount) {
1325  for (int i = oldGridRowCount - 1; i >= 1; --i) {
1326  for (int j = oldGridColumnCount - 1; j >= 0; --j) {
1327  int oldIndex = (i * oldGridColumnCount) + j;
1328  int newIndex = (i * newGridColumnCount) + j;
1329 
1330  Q_ASSERT(newIndex > oldIndex);
1331  q_grid[newIndex] = q_grid[oldIndex];
1332  q_grid[oldIndex] = 0;
1333  }
1334  }
1335  }
1336  }
1337 }
int count(const T &t) const
Returns the number of occurrences of value in the vector.
Definition: qvector.h:742
int internalGridColumnCount() const
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
QVector< QGridLayoutItem * > q_grid
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
void resize(int size)
Sets the size of the vector to size.
Definition: qvector.h:342
QGridLayoutRowInfo q_infos[NOrientations]
void qSwap(T &value1, T &value2)
Definition: qglobal.h:2181
int internalGridRowCount() const

◆ regenerateGrid()

void QGridLayoutEngine::regenerateGrid ( )
private

Definition at line 1339 of file qgridlayoutengine.cpp.

1340 {
1341  q_grid.fill(0);
1342 
1343  for (int i = q_items.count() - 1; i >= 0; --i) {
1344  QGridLayoutItem *item = q_items.at(i);
1345 
1346  for (int j = item->firstRow(); j <= item->lastRow(); ++j) {
1347  for (int k = item->firstColumn(); k <= item->lastColumn(); ++k) {
1348  setItemAt(j, k, item);
1349  }
1350  }
1351  }
1352 }
QList< QGridLayoutItem * > q_items
QVector< T > & fill(const T &t, int size=-1)
Assigns value to all items in the vector.
Definition: qvector.h:665
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
QVector< QGridLayoutItem * > q_grid
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
void setItemAt(int row, int column, QGridLayoutItem *item)

◆ removeItem()

void QGridLayoutEngine::removeItem ( QGridLayoutItem item)

Definition at line 1034 of file qgridlayoutengine.cpp.

Referenced by QGraphicsLinearLayoutPrivate::removeGridItem().

1035 {
1036  Q_ASSERT(q_items.contains(item));
1037 
1038  invalidate();
1039 
1040  for (int i = item->firstRow(); i <= item->lastRow(); ++i) {
1041  for (int j = item->firstColumn(); j <= item->lastColumn(); ++j) {
1042  if (itemAt(i, j) == item)
1043  setItemAt(i, j, 0);
1044  }
1045  }
1046 
1047  q_items.removeAll(item);
1048 }
QList< QGridLayoutItem * > q_items
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
QBool contains(const T &t) const
Returns true if the list contains an occurrence of value; otherwise returns false.
Definition: qlist.h:880
QGridLayoutItem * itemAt(int index) const
void setItemAt(int row, int column, QGridLayoutItem *item)
int removeAll(const T &t)
Removes all occurrences of value in the list and returns the number of entries removed.
Definition: qlist.h:770

◆ removeRows()

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

Definition at line 382 of file qgridlayoutengine_p.h.

Referenced by QGraphicsLinearLayoutPrivate::removeGridItem().

383  { insertOrRemoveRows(row, -count, orientation); }
void insertOrRemoveRows(int row, int delta, Qt::Orientation orientation=Qt::Vertical)

◆ rowAlignment()

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

Definition at line 966 of file qgridlayoutengine.cpp.

967 {
968  Q_ASSERT(row >= 0);
969  return q_infos[orientation == Qt::Vertical].alignments.value(row);
970 }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
QVector< Qt::Alignment > alignments
QGridLayoutRowInfo q_infos[NOrientations]
T value(int i) const
Returns the value at index position i in the vector.
Definition: qvector.h:559

◆ rowCount() [1/2]

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

Definition at line 809 of file qgridlayoutengine.cpp.

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

810 {
811  return q_infos[orientation == Qt::Vertical].count;
812 }
QGridLayoutRowInfo q_infos[NOrientations]

◆ rowCount() [2/2]

int QGridLayoutEngine::rowCount ( ) const
inline

Definition at line 339 of file qgridlayoutengine_p.h.

339 { return q_infos[Ver].count; }
QGridLayoutRowInfo q_infos[NOrientations]

◆ rowSizeHint()

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

Definition at line 948 of file qgridlayoutengine.cpp.

949 {
950  return q_infos[orientation == Qt::Vertical].boxes.value(row).q_sizes(which);
951 }
QGridLayoutRowInfo q_infos[NOrientations]
T value(int i) const
Returns the value at index position i in the vector.
Definition: qvector.h:559
qreal & q_sizes(int which)
QVector< QGridLayoutBox > boxes

◆ rowSpacing()

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

Definition at line 889 of file qgridlayoutengine.cpp.

890 {
892  if (!spacing.isDefault())
893  return spacing.value();
894  return q_defaultSpacings[orientation == Qt::Vertical].value();
895 }
QGridLayoutRowInfo q_infos[NOrientations]
T value(int i) const
Returns the value at index position i in the vector.
Definition: qvector.h:559
qreal spacing(const QLayoutStyleInfo &styleInfo, Qt::Orientation orientation) const
QVector< QLayoutParameter< qreal > > spacings
QLayoutParameter< qreal > q_defaultSpacings[NOrientations]

◆ rowStretchFactor()

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

Definition at line 910 of file qgridlayoutengine.cpp.

911 {
912  QStretchParameter stretch = q_infos[orientation == Qt::Vertical].stretches.value(row);
913  if (!stretch.isDefault())
914  return stretch.value();
915  return 0;
916 }
QVector< QStretchParameter > stretches
QGridLayoutRowInfo q_infos[NOrientations]
T value(int i) const
Returns the value at index position i in the vector.
Definition: qvector.h:559

◆ setAlignment()

void QGridLayoutEngine::setAlignment ( QGraphicsLayoutItem layoutItem,
Qt::Alignment  alignment 
)

Definition at line 972 of file qgridlayoutengine.cpp.

973 {
974  if (QGridLayoutItem *item = findLayoutItem(layoutItem))
975  item->setAlignment(alignment);
976  invalidate();
977 }
Qt::Alignment alignment(QGraphicsLayoutItem *layoutItem) const
QGridLayoutItem * findLayoutItem(QGraphicsLayoutItem *layoutItem) const

◆ setGeometries()

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

Definition at line 1086 of file qgridlayoutengine.cpp.

1088 {
1089  if (rowCount() < 1 || columnCount() < 1)
1090  return;
1091 
1092  ensureGeometries(styleInfo, contentsGeometry.size());
1093 
1094  for (int i = q_items.count() - 1; i >= 0; --i) {
1095  QGridLayoutItem *item = q_items.at(i);
1096 
1097  qreal x = q_xx[item->firstColumn()];
1098  qreal y = q_yy[item->firstRow()];
1099  qreal width = q_widths[item->lastColumn()];
1100  qreal height = q_heights[item->lastRow()];
1101 
1102  if (item->columnSpan() != 1)
1103  width += q_xx[item->lastColumn()] - x;
1104  if (item->rowSpan() != 1)
1105  height += q_yy[item->lastRow()] - y;
1106 
1107  QRectF geom = item->geometryWithin(contentsGeometry.x() + x, contentsGeometry.y() + y,
1108  width, height, q_descents[item->lastRow()]);
1109  visualRect(&geom, visualDirection(), contentsGeometry);
1110  item->setGeometry(geom);
1111  }
1112 }
QList< QGridLayoutItem * > q_items
qreal y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:667
double qreal
Definition: qglobal.h:1193
void setGeometry(const QRectF &rect)
QVector< qreal > q_descents
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
QVector< qreal > q_yy
void ensureGeometries(const QLayoutStyleInfo &styleInfo, const QSizeF &size) const
QRectF geometryWithin(qreal x, qreal y, qreal width, qreal height, qreal rowDescent) const
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
QVector< qreal > q_xx
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
qreal x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:664
QVector< qreal > q_heights
QVector< qreal > q_widths
QSizeF size() const
Returns the size of the rectangle.
Definition: qrect.h:713
Qt::LayoutDirection visualDirection() const
static void visualRect(QRectF *geom, Qt::LayoutDirection dir, const QRectF &contentsRect)

◆ setItemAt()

void QGridLayoutEngine::setItemAt ( int  row,
int  column,
QGridLayoutItem item 
)
private

Definition at line 1354 of file qgridlayoutengine.cpp.

1355 {
1356  Q_ASSERT(row >= 0 && row < rowCount());
1357  Q_ASSERT(column >= 0 && column < columnCount());
1358  q_grid[(row * internalGridColumnCount()) + column] = item;
1359 }
int internalGridColumnCount() const
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
QVector< QGridLayoutItem * > q_grid

◆ setRowAlignment()

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

Definition at line 953 of file qgridlayoutengine.cpp.

955 {
956  Q_ASSERT(row >= 0);
957 
958  maybeExpandGrid(row, -1, orientation);
959 
960  QGridLayoutRowInfo &rowInfo = q_infos[orientation == Qt::Vertical];
961  if (row >= rowInfo.alignments.count())
962  rowInfo.alignments.resize(row + 1);
963  rowInfo.alignments[row] = alignment;
964 }
int count(const T &t) const
Returns the number of occurrences of value in the vector.
Definition: qvector.h:742
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
void resize(int size)
Sets the size of the vector to size.
Definition: qvector.h:342
QVector< Qt::Alignment > alignments
QGridLayoutRowInfo q_infos[NOrientations]
Qt::Alignment alignment(QGraphicsLayoutItem *layoutItem) const
void maybeExpandGrid(int row, int column, Qt::Orientation orientation=Qt::Vertical)

◆ setRowSizeHint()

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

Definition at line 934 of file qgridlayoutengine.cpp.

936 {
937  Q_ASSERT(row >= 0);
938  Q_ASSERT(size >= 0.0);
939 
940  maybeExpandGrid(row, -1, orientation);
941 
942  QGridLayoutRowInfo &rowInfo = q_infos[orientation == Qt::Vertical];
943  if (row >= rowInfo.boxes.count())
944  rowInfo.boxes.resize(row + 1);
945  rowInfo.boxes[row].q_sizes(which) = size;
946 }
int count(const T &t) const
Returns the number of occurrences of value in the vector.
Definition: qvector.h:742
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
void resize(int size)
Sets the size of the vector to size.
Definition: qvector.h:342
QGridLayoutRowInfo q_infos[NOrientations]
QVector< QGridLayoutBox > boxes
void maybeExpandGrid(int row, int column, Qt::Orientation orientation=Qt::Vertical)

◆ setRowSpacing()

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

Definition at line 875 of file qgridlayoutengine.cpp.

876 {
877  Q_ASSERT(row >= 0);
878 
879  QGridLayoutRowInfo &rowInfo = q_infos[orientation == Qt::Vertical];
880  if (row >= rowInfo.spacings.count())
881  rowInfo.spacings.resize(row + 1);
882  if (spacing >= 0)
883  rowInfo.spacings[row].setUserValue(spacing);
884  else
885  rowInfo.spacings[row] = QLayoutParameter<qreal>();
886  invalidate();
887 }
int count(const T &t) const
Returns the number of occurrences of value in the vector.
Definition: qvector.h:742
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
void resize(int size)
Sets the size of the vector to size.
Definition: qvector.h:342
QGridLayoutRowInfo q_infos[NOrientations]
qreal spacing(const QLayoutStyleInfo &styleInfo, Qt::Orientation orientation) const
QVector< QLayoutParameter< qreal > > spacings

◆ setRowStretchFactor()

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

Definition at line 897 of file qgridlayoutengine.cpp.

898 {
899  Q_ASSERT(row >= 0);
900  Q_ASSERT(stretch >= 0);
901 
902  maybeExpandGrid(row, -1, orientation);
903 
904  QGridLayoutRowInfo &rowInfo = q_infos[orientation == Qt::Vertical];
905  if (row >= rowInfo.stretches.count())
906  rowInfo.stretches.resize(row + 1);
907  rowInfo.stretches[row].setUserValue(stretch);
908 }
int count(const T &t) const
Returns the number of occurrences of value in the vector.
Definition: qvector.h:742
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
void resize(int size)
Sets the size of the vector to size.
Definition: qvector.h:342
QVector< QStretchParameter > stretches
QGridLayoutRowInfo q_infos[NOrientations]
void maybeExpandGrid(int row, int column, Qt::Orientation orientation=Qt::Vertical)

◆ setSpacing()

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

Definition at line 851 of file qgridlayoutengine.cpp.

852 {
853  Q_ASSERT(spacing >= 0.0);
854  if (orientations & Qt::Horizontal)
856  if (orientations & Qt::Vertical)
858 
859  invalidate();
860 }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
void setUserValue(T value)
qreal spacing(const QLayoutStyleInfo &styleInfo, Qt::Orientation orientation) const
QLayoutParameter< qreal > q_defaultSpacings[NOrientations]

◆ setStretchFactor()

void QGridLayoutEngine::setStretchFactor ( QGraphicsLayoutItem layoutItem,
int  stretch,
Qt::Orientation  orientation 
)

Definition at line 918 of file qgridlayoutengine.cpp.

920 {
921  Q_ASSERT(stretch >= 0);
922 
923  if (QGridLayoutItem *item = findLayoutItem(layoutItem))
924  item->setStretchFactor(stretch, orientation);
925 }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
QGridLayoutItem * findLayoutItem(QGraphicsLayoutItem *layoutItem) const

◆ setVisualDirection()

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

Definition at line 1242 of file qgridlayoutengine.cpp.

1243 {
1245 }
Qt::LayoutDirection m_visualDirection
Qt::LayoutDirection direction

◆ sizeHint()

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

Definition at line 1141 of file qgridlayoutengine.cpp.

1143 {
1144  QGridLayoutBox sizehint_totalBoxes[NOrientations];
1145 
1146  bool sizeHintCalculated = false;
1147 
1148  if (hasDynamicConstraint() && rowCount() > 0 && columnCount() > 0) {
1150  //We have items whose height depends on their width
1151  if (constraint.width() >= 0) {
1152  if (q_cachedDataForStyleInfo != styleInfo)
1153  ensureColumnAndRowData(&q_columnData, &sizehint_totalBoxes[Hor], styleInfo, NULL, NULL, Qt::Horizontal);
1154  else
1155  sizehint_totalBoxes[Hor] = q_totalBoxes[Hor];
1156  QVector<qreal> sizehint_xx;
1157  QVector<qreal> sizehint_widths;
1158 
1159  sizehint_xx.resize(columnCount());
1160  sizehint_widths.resize(columnCount());
1161  qreal width = constraint.width();
1162  //Calculate column widths and positions, and put results in q_xx.data() and q_widths.data() so that we can use this information as
1163  //constraints to find the row heights
1164  q_columnData.calculateGeometries(0, columnCount(), width, sizehint_xx.data(), sizehint_widths.data(),
1165  0, sizehint_totalBoxes[Hor], q_infos[Hor]);
1166  ensureColumnAndRowData(&q_rowData, &sizehint_totalBoxes[Ver], styleInfo, sizehint_xx.data(), sizehint_widths.data(), Qt::Vertical);
1167  sizeHintCalculated = true;
1168  }
1169  } else {
1170  if (constraint.height() >= 0) {
1171  //We have items whose width depends on their height
1172  ensureColumnAndRowData(&q_rowData, &sizehint_totalBoxes[Ver], styleInfo, NULL, NULL, Qt::Vertical);
1173  QVector<qreal> sizehint_yy;
1174  QVector<qreal> sizehint_heights;
1175 
1176  sizehint_yy.resize(rowCount());
1177  sizehint_heights.resize(rowCount());
1178  qreal height = constraint.height();
1179  //Calculate row heights and positions, and put results in q_yy.data() and q_heights.data() so that we can use this information as
1180  //constraints to find the column widths
1181  q_rowData.calculateGeometries(0, rowCount(), height, sizehint_yy.data(), sizehint_heights.data(),
1182  0, sizehint_totalBoxes[Ver], q_infos[Ver]);
1183  ensureColumnAndRowData(&q_columnData, &sizehint_totalBoxes[Hor], styleInfo, sizehint_yy.data(), sizehint_heights.data(), Qt::Horizontal);
1184  sizeHintCalculated = true;
1185  }
1186  }
1187  }
1188 
1189  if (!sizeHintCalculated) {
1190  //No items with height for width, so it doesn't matter which order we do these in
1191  if (q_cachedDataForStyleInfo != styleInfo) {
1192  ensureColumnAndRowData(&q_columnData, &sizehint_totalBoxes[Hor], styleInfo, NULL, NULL, Qt::Horizontal);
1193  ensureColumnAndRowData(&q_rowData, &sizehint_totalBoxes[Ver], styleInfo, NULL, NULL, Qt::Vertical);
1194  } else {
1195  sizehint_totalBoxes[Hor] = q_totalBoxes[Hor];
1196  sizehint_totalBoxes[Ver] = q_totalBoxes[Ver];
1197  }
1198  }
1199 
1200  switch (which) {
1201  case Qt::MinimumSize:
1202  return QSizeF(sizehint_totalBoxes[Hor].q_minimumSize, sizehint_totalBoxes[Ver].q_minimumSize);
1203  case Qt::PreferredSize:
1204  return QSizeF(sizehint_totalBoxes[Hor].q_preferredSize, sizehint_totalBoxes[Ver].q_preferredSize);
1205  case Qt::MaximumSize:
1206  return QSizeF(sizehint_totalBoxes[Hor].q_maximumSize, sizehint_totalBoxes[Ver].q_maximumSize);
1207  case Qt::MinimumDescent:
1208  return QSizeF(-1.0, sizehint_totalBoxes[Hor].q_minimumDescent); // ### doesn't work
1209  default:
1210  break;
1211  }
1212  return QSizeF();
1213 }
QGridLayoutRowData q_columnData
double qreal
Definition: qglobal.h:1193
qreal width() const
Returns the width.
Definition: qsize.h:284
qreal height() const
Returns the height.
Definition: qsize.h:287
QGridLayoutBox q_totalBoxes[NOrientations]
The QSizeF class defines the size of a two-dimensional object using floating point precision...
Definition: qsize.h:202
void resize(int size)
Sets the size of the vector to size.
Definition: qvector.h:342
QGridLayoutRowData q_rowData
QGridLayoutRowInfo q_infos[NOrientations]
bool hasDynamicConstraint() const
void ensureColumnAndRowData(QGridLayoutRowData *rowData, QGridLayoutBox *totalBox, const QLayoutStyleInfo &styleInfo, qreal *colPositions, qreal *colSizes, Qt::Orientation orientation) const
Qt::Orientation constraintOrientation() const
T * data()
Returns a pointer to the data stored in the vector.
Definition: qvector.h:152
void calculateGeometries(int start, int end, qreal targetSize, qreal *positions, qreal *sizes, qreal *descents, const QGridLayoutBox &totalBox, const QGridLayoutRowInfo &rowInfo)
QLayoutStyleInfo q_cachedDataForStyleInfo

◆ spacing()

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

Definition at line 862 of file qgridlayoutengine.cpp.

863 {
864  if (q_defaultSpacings[orientation == Qt::Vertical].isDefault()) {
865  QStyle *style = styleInfo.style();
866  QStyleOption option;
867  option.initFrom(styleInfo.widget());
868  qreal defaultSpacing = (qreal)style->pixelMetric(orientation == Qt::Vertical ? QStyle::PM_LayoutVerticalSpacing
869  : QStyle::PM_LayoutHorizontalSpacing, &option, styleInfo.widget());
870  q_defaultSpacings[orientation == Qt::Vertical].setCachedValue(defaultSpacing);
871  }
872  return q_defaultSpacings[orientation == Qt::Vertical].value();
873 }
void setCachedValue(T value) const
double qreal
Definition: qglobal.h:1193
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option=0, const QWidget *widget=0) const =0
Returns the value of the given pixel metric.
QStyle * style() const
The QStyleOption class stores the parameters used by QStyle functions.
Definition: qstyleoption.h:67
void initFrom(const QWidget *w)
Definition: qstyleoption.h:99
QWidget * widget() const
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI...
Definition: qstyle.h:68
QLayoutParameter< qreal > q_defaultSpacings[NOrientations]

◆ stretchFactor()

int QGridLayoutEngine::stretchFactor ( QGraphicsLayoutItem layoutItem,
Qt::Orientation  orientation 
) const

Definition at line 927 of file qgridlayoutengine.cpp.

928 {
929  if (QGridLayoutItem *item = findLayoutItem(layoutItem))
930  return item->stretchFactor(orientation);
931  return 0;
932 }
QGridLayoutItem * findLayoutItem(QGraphicsLayoutItem *layoutItem) const

◆ transpose()

void QGridLayoutEngine::transpose ( )

Definition at line 1229 of file qgridlayoutengine.cpp.

1230 {
1231  invalidate();
1232 
1233  for (int i = q_items.count() - 1; i >= 0; --i)
1234  q_items.at(i)->transpose();
1235 
1237  qSwap(q_infos[Hor], q_infos[Ver]);
1238 
1239  regenerateGrid();
1240 }
QList< QGridLayoutItem * > q_items
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
QGridLayoutRowInfo q_infos[NOrientations]
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
void qSwap(T &value1, T &value2)
Definition: qglobal.h:2181
QLayoutParameter< qreal > q_defaultSpacings[NOrientations]

◆ visualDirection()

Qt::LayoutDirection QGridLayoutEngine::visualDirection ( ) const

Definition at line 1247 of file qgridlayoutengine.cpp.

1248 {
1249  return m_visualDirection;
1250 }
Qt::LayoutDirection m_visualDirection

Friends and Related Functions

◆ QGridLayoutItem

friend class QGridLayoutItem
friend

Definition at line 453 of file qgridlayoutengine_p.h.

Properties

◆ m_visualDirection

Qt::LayoutDirection QGridLayoutEngine::m_visualDirection
private

Definition at line 432 of file qgridlayoutengine_p.h.

◆ q_cachedConstraintOrientation

quint8 QGridLayoutEngine::q_cachedConstraintOrientation
mutableprivate

Definition at line 437 of file qgridlayoutengine_p.h.

◆ q_cachedDataForStyleInfo

QLayoutStyleInfo QGridLayoutEngine::q_cachedDataForStyleInfo
mutableprivate

Definition at line 440 of file qgridlayoutengine_p.h.

◆ q_cachedEffectiveFirstRows

int QGridLayoutEngine::q_cachedEffectiveFirstRows[NOrientations]
mutableprivate

Definition at line 435 of file qgridlayoutengine_p.h.

◆ q_cachedEffectiveLastRows

int QGridLayoutEngine::q_cachedEffectiveLastRows[NOrientations]
mutableprivate

Definition at line 436 of file qgridlayoutengine_p.h.

◆ q_cachedSize

QSizeF QGridLayoutEngine::q_cachedSize
mutableprivate

Definition at line 446 of file qgridlayoutengine_p.h.

◆ q_columnData

QGridLayoutRowData QGridLayoutEngine::q_columnData
mutableprivate

Definition at line 441 of file qgridlayoutengine_p.h.

◆ q_defaultSpacings

QLayoutParameter<qreal> QGridLayoutEngine::q_defaultSpacings[NOrientations]
private

Definition at line 430 of file qgridlayoutengine_p.h.

◆ q_descents

QVector<qreal> QGridLayoutEngine::q_descents
mutableprivate

Definition at line 451 of file qgridlayoutengine_p.h.

◆ q_grid

QVector<QGridLayoutItem *> QGridLayoutEngine::q_grid
private

Definition at line 428 of file qgridlayoutengine_p.h.

◆ q_heights

QVector<qreal> QGridLayoutEngine::q_heights
mutableprivate

Definition at line 450 of file qgridlayoutengine_p.h.

◆ q_infos

QGridLayoutRowInfo QGridLayoutEngine::q_infos[NOrientations]
private

Definition at line 431 of file qgridlayoutengine_p.h.

◆ q_items

QList<QGridLayoutItem *> QGridLayoutEngine::q_items
private

Definition at line 429 of file qgridlayoutengine_p.h.

◆ q_rowData

QGridLayoutRowData QGridLayoutEngine::q_rowData
mutableprivate

Definition at line 442 of file qgridlayoutengine_p.h.

◆ q_totalBoxes

QGridLayoutBox QGridLayoutEngine::q_totalBoxes[NOrientations]
mutableprivate

Definition at line 443 of file qgridlayoutengine_p.h.

◆ q_widths

QVector<qreal> QGridLayoutEngine::q_widths
mutableprivate

Definition at line 449 of file qgridlayoutengine_p.h.

◆ q_xx

QVector<qreal> QGridLayoutEngine::q_xx
mutableprivate

Definition at line 447 of file qgridlayoutengine_p.h.

◆ q_yy

QVector<qreal> QGridLayoutEngine::q_yy
mutableprivate

Definition at line 448 of file qgridlayoutengine_p.h.


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