10#include <QtCore/qmath.h>
23 }
else if (delta < 0) {
32 return desired *
qPow(sumAvailable / sumDesired, desired / sumDesired);
42 Q_ASSERT(targetSize >= ascent + descent);
44 qreal extra = targetSize - (ascent + descent);
45 return descent + (extra / 2.0);
78 maxMax =
other.q_maximumSize;
99#ifdef QGRIDLAYOUTENGINE_DEBUG
100void QGridLayoutBox::dump(
int indent)
const
131 int start =
i.key().first;
132 int span =
i.key().second;
135 int stretch =
i.value().q_stretch;
146 nullptr,
totalBox, rowInfo, snapToPixelGrid);
148 for (
int k = 0; k <
span; ++k)
149 extras[k].q_sizes(
j) = newSizes[k];
153 for (
int k = 0; k <
span; ++k) {
166 return std::floor(
f +
qreal(0.5));
182 qreal sumFactors = 0.0;
183 int sumStretches = 0;
186 for (
int i = 0;
i <
n; ++
i) {
189 sumStretches += stretch;
196 if (sumAvailable > 0.0) {
199 for (
int i = 0;
i <
n; ++
i) {
208 sumFactors += factors[
i];
211 for (
int i = 0;
i <
n; ++
i) {
213 qreal delta = sumAvailable * factors[
i] / sumFactors;
214 newSizes[
i] =
sizes[
i] + delta;
219 if (isLargerThanMaximum) {
227 if (sumAvailable > 0.0) {
228 qreal sumCurrentAvailable = sumAvailable;
229 bool somethingHasAMaximumSize =
false;
231 qreal sumSizes = 0.0;
232 for (
int i = 0;
i <
n; ++
i)
235 for (
int i = 0;
i <
n; ++
i) {
246 if (isLargerThanMaximum) {
250 boxSize =
box.q_preferredSize;
251 desired =
box.q_maximumSize - boxSize;
253 if (desired == 0.0) {
260 if (sumStretches == 0) {
262 factors[
i] = (stretch < 0) ? 1.0 : 0.0;
264 factors[
i] = (stretch < 0) ?
sizes[
i] : 0.0;
266 }
else if (stretch == sumStretches) {
268 }
else if (stretch <= 0) {
272 qreal ultimateSumSizes;
273 qreal x = ((stretch * sumSizes)
274 - (sumStretches * boxSize))
275 / (sumStretches - stretch);
277 ultimateSize = boxSize +
x;
278 ultimateSumSizes = sumSizes +
x;
280 ultimateSize = boxSize;
281 ultimateSumSizes = (sumStretches * boxSize)
290 ultimateSize = ultimateSize * 3 / 2;
291 ultimateSumSizes = ultimateSumSizes * 3 / 2;
293 qreal beta = ultimateSumSizes - sumSizes;
298 qreal ultimateFactor = (stretch * ultimateSumSizes / sumStretches)
300 qreal transitionalFactor = sumCurrentAvailable * (ultimateSize - boxSize) / beta;
302 factors[
i] = ((
alpha * ultimateFactor)
303 + ((beta -
alpha) * transitionalFactor)) / beta;
307 sumFactors += factors[
i];
308 if (desired < sumCurrentAvailable)
309 somethingHasAMaximumSize =
true;
315 bool keepGoing = somethingHasAMaximumSize;
320 for (
int i = 0;
i <
n; ++
i) {
321 if (newSizes[
i] >= 0.0)
326 qreal maxBoxSize =
box.q_maximumSize;
329 maxBoxSize =
qMax(
box.q_minimumSize, std::floor(maxBoxSize));
331 qreal avail = sumCurrentAvailable * factors[
i] / sumFactors;
332 if (
sizes[
i] + avail >= maxBoxSize) {
333 newSizes[
i] = maxBoxSize;
334 sumCurrentAvailable -= maxBoxSize -
sizes[
i];
335 sumFactors -= factors[
i];
336 keepGoing = (sumCurrentAvailable > 0.0);
342 for (
int i = 0;
i <
n; ++
i) {
343 if (newSizes[
i] < 0.0) {
344 qreal delta = (sumFactors == 0.0) ? 0.0
345 : sumCurrentAvailable * factors[
i] / sumFactors;
346 newSizes[
i] =
sizes[
i] + delta;
352 if (sumAvailable > 0) {
354 for (
int i = 0;
i <
n; ++
i) {
365 int prevSurplus = -1;
366 while (surplus > 0 && surplus != prevSurplus) {
367 prevSurplus = surplus;
370 for (
int i = 0;
i <
n; ++
i) {
373 && factors[
i] > 0 &&
sizes[
i] <
box.q_maximumSize)
385 if (snapToPixelGrid) {
386 for (
int i = 0;
i <
n; ++
i) {
399 for (
int i = 0;
i <
n; ++
i) {
406 for (
int i = 0;
i <
n; ++
i) {
419 result.q_maximumSize = 0.0;
420 qreal nextSpacing = 0.0;
434 qreal nextSpacing = 0.0;
452#ifdef QGRIDLAYOUTENGINE_DEBUG
453void QGridLayoutRowData::dump(
int indent)
const
455 qDebug(
"%*sData", indent,
"");
461 qDebug(
"%*s Ignored", indent,
"");
467 qDebug(
"%*s Multi-cell entry <%d, %d> (stretch %d)", indent,
"",
it.key().first,
468 it.key().second,
it.value().q_stretch);
469 it.value().q_box.dump(indent + 2);
477 q_rowSpans{columnSpan, rowSpan},
485 return q_firstRows[orientation];
505 return q_rowSpans[orientation];
515 q_firstRows[orientation] =
row;
520 q_rowSpans[orientation] =
rowSpan;
525 int stretch = q_stretches[orientation];
543 q_stretches[orientation] = stretch;
557 QSizeF constraintSize(-1.0, constraint);
575 QSizeF constraintSize(constraint, -1.0);
595 if (
result.q_minimumDescent != -1.0) {
597 result.q_minimumDescent -= (minSizeHint -
result.q_minimumSize);
609 qreal rowDescent, Qt::Alignment align,
bool snapToPixelGrid)
const
617 if (
size.width() > cellWidth)
619 }
else if (
size.height() > cellHeight) {
629 x += (cellWidth -
width)/2;
650 y += (cellHeight - rowDescent - ascent);
651 height = ascent + descent;
668 int oldFirstRow =
firstRow(orientation);
669 if (oldFirstRow >=
row) {
688 if (!vGrow || !hGrow) {
696 if (!
size.isValid()) {
698 if (
size.width() == -1)
700 if (
size.height() == -1)
706#ifdef QGRIDLAYOUTENGINE_DEBUG
707void QGridLayoutItem::dump(
int indent)
const
716 if (q_alignment != 0)
717 qDebug(
"%*s Alignment: %x", indent,
"",
uint(q_alignment));
718 qDebug(
"%*s Horizontal size policy: %x Vertical size policy: %x",
733#ifdef QGRIDLAYOUTENGINE_DEBUG
734void QGridLayoutRowInfo::dump(
int indent)
const
759 m_defaultAlignment = defaultAlignment;
760 m_snapToPixelGrid = snapToPixelGrid;
761 m_uniformCellWidths =
false;
762 m_uniformCellHeights =
false;
768 return q_infos[orientation].count;
773 return q_infos.
transposed()[orientation].count;
789 ensureEffectiveFirstAndLastRows();
790 return q_cachedEffectiveFirstRows[orientation];
795 ensureEffectiveFirstAndLastRows();
796 return q_cachedEffectiveLastRows[orientation];
811 if (!q_defaultSpacings[orientation].isUser()) {
813 q_defaultSpacings[orientation].setCachedValue(defaultSpacing);
815 return q_defaultSpacings[orientation].value();
837 return q_defaultSpacings[orientation].value();
845 maybeExpandGrid(
row, -1, orientation);
857 return stretch.
value();
867 maybeExpandGrid(
row, -1, orientation);
877 return q_infos[orientation].boxes.value(
row).q_sizes(which);
882 return m_uniformCellWidths;
896 return m_uniformCellHeights;
913 maybeExpandGrid(
row, -1, orientation);
924 return q_infos[orientation].alignments.value(
row);
929 Qt::Alignment align =
layoutItem->alignment();
954 maybeExpandGrid(
item->lastRow(),
item->lastColumn());
961 for (
int i =
item->firstRow();
i <=
item->lastRow(); ++
i) {
962 for (
int j =
item->firstColumn();
j <=
item->lastColumn(); ++
j) {
964 qWarning(
"QGridLayoutEngine::addItem: Cell (%d, %d) already taken",
i,
j);
981 for (
int i =
item->firstRow();
i <=
item->lastRow(); ++
i) {
982 for (
int j =
item->firstColumn();
j <=
item->lastColumn(); ++
j) {
984 setItemAt(
i,
j,
nullptr);
998 return q_grid.
at((
row * internalGridColumnCount()) +
column);
1003 q_cachedEffectiveFirstRows = {-1, -1};
1004 q_cachedEffectiveLastRows = {-1, -1};
1006 q_totalBoxCachedConstraints = {NotCached, NotCached};
1023 ensureGeometries(contentsGeometry.
size(), styleInfo);
1033 if (
item->columnSpan() != 1)
1035 if (
item->rowSpan() != 1)
1039 QRectF geom =
item->geometryWithin(contentsGeometry.
x() +
x, contentsGeometry.
y() +
y,
1041 if (m_snapToPixelGrid) {
1052 item->setGeometry(geom);
1061 || rowSpan < 1 || columnSpan < 1)
1064 ensureGeometries(contentsGeometry.
size(), styleInfo);
1074 if (columnSpan != 1)
1075 width += q_xx[lastColumn] -
x;
1089 bool sizeHintCalculated =
false;
1092 if (constraint.
width() >= 0) {
1105 sizeHintCalculated =
true;
1108 if (constraint.
height() >= 0) {
1122 sizeHintCalculated =
true;
1125 if (sizeHintCalculated)
1141 QLayoutPolicy::ControlTypes
result;
1170 return m_visualDirection;
1173#ifdef QGRIDLAYOUTENGINE_DEBUG
1174void QGridLayoutEngine::dump(
int indent)
const
1176 qDebug(
"%*sEngine", indent,
"");
1183 qDebug(
"%*s Grid (%d x %d)", indent,
"", internalGridRowCount(),
1184 internalGridColumnCount());
1185 for (
int row = 0;
row < internalGridRowCount(); ++
row) {
1196 qDebug(
"%*s Default spacings: %g %g", indent,
"",
1200 qDebug(
"%*s Column and row info", indent,
"");
1204 qDebug(
"%*s Column and row data", indent,
"");
1205 q_columnData.dump(indent + 2);
1206 q_rowData.dump(indent + 2);
1208 qDebug(
"%*s Geometries output", indent,
"");
1210 for (
int pass = 0; pass < 2; ++pass) {
1212 for (
i = 0;
i < cellPos->
count(); ++
i) {
1233 int oldGridRowCount = internalGridRowCount();
1234 int oldGridColumnCount = internalGridColumnCount();
1239 int newGridRowCount = internalGridRowCount();
1240 int newGridColumnCount = internalGridColumnCount();
1242 int newGridSize = newGridRowCount * newGridColumnCount;
1243 if (newGridSize != q_grid.
size()) {
1244 q_grid.
resize(newGridSize);
1246 if (newGridColumnCount != oldGridColumnCount) {
1247 for (
int i = oldGridRowCount - 1;
i >= 1; --
i) {
1248 for (
int j = oldGridColumnCount - 1;
j >= 0; --
j) {
1249 int oldIndex = (
i * oldGridColumnCount) +
j;
1250 int newIndex = (
i * newGridColumnCount) +
j;
1253 q_grid[newIndex] = q_grid[oldIndex];
1254 q_grid[oldIndex] =
nullptr;
1261void QGridLayoutEngine::regenerateGrid()
1263 q_grid.
fill(
nullptr);
1268 for (
int j =
item->firstRow();
j <=
item->lastRow(); ++
j) {
1269 for (
int k =
item->firstColumn(); k <=
item->lastColumn(); ++k) {
1270 setItemAt(
j, k,
item);
1283void QGridLayoutEngine::insertOrRemoveRows(
int row,
int delta,
Qt::Orientation orientation)
1285 int oldRowCount =
rowCount(orientation);
1291 if (
row == oldRowCount && delta > 0) {
1292 maybeExpandGrid(oldRowCount + delta - 1, -1, orientation);
1296 q_infos[orientation].insertOrRemoveRows(
row, delta);
1301 q_grid.
resize(internalGridRowCount() * internalGridColumnCount());
1306 const qreal *colPositions,
const qreal *colSizes,
1318 if (innerSpacing >= 0.0)
1322 bool rowIsEmpty =
true;
1323 bool rowIsIdenticalToPrevious = (
row > 0);
1329 rowIsIdenticalToPrevious =
false;
1335 if ((rowIsEmpty || rowIsIdenticalToPrevious)
1343 }
else if (!defaultSpacing.
isDefault()) {
1350 struct RowAdHocData {
1352 unsigned int q_hasButtons : 8;
1353 unsigned int q_hasNonButtons : 8;
1355 inline RowAdHocData() : q_row(-1), q_hasButtons(
false), q_hasNonButtons(
false) {}
1358 q_hasButtons =
false;
1359 q_hasNonButtons =
false;
1361 inline bool hasOnlyButtons()
const {
return q_hasButtons && !q_hasNonButtons; }
1362 inline bool hasOnlyNonButtons()
const {
return q_hasNonButtons && !q_hasButtons; }
1364 RowAdHocData lastRowAdHocData;
1365 RowAdHocData nextToLastRowAdHocData;
1366 RowAdHocData nextToNextToLastRowAdHocData;
1375 nextToNextToLastRowAdHocData = nextToLastRowAdHocData;
1376 nextToLastRowAdHocData = lastRowAdHocData;
1377 lastRowAdHocData.init(
row);
1383 bool hasIgnoreFlag =
true;
1387 int itemRow =
item->firstRow(orientation);
1388 int itemColumn =
item->firstColumn(orientation);
1390 if (itemRow ==
row && itemColumn ==
column) {
1391 int itemStretch =
item->stretchFactor(orientation);
1393 hasIgnoreFlag =
false;
1394 int itemRowSpan =
item->rowSpan(orientation);
1396 int effectiveRowSpan = 1;
1397 for (
int i = 1;
i < itemRowSpan; ++
i) {
1403 if (effectiveRowSpan == 1) {
1405 if (!userRowStretch && itemStretch != 0)
1406 rowStretch =
qMax(rowStretch, itemStretch);
1414 if (colSizes && colPositions &&
item->hasDynamicConstraint() && orientation ==
item->dynamicConstraintOrientation()) {
1422 if (
item->columnSpan(orientation) != 1)
1423 length += colPositions[
item->lastColumn(orientation)] - colPositions[
item->firstColumn(orientation)];
1424 box->combine(
item->box(orientation, m_snapToPixelGrid,
length));
1426 box->combine(
item->box(orientation, m_snapToPixelGrid));
1429 if (effectiveRowSpan == 1) {
1430 QLayoutPolicy::ControlTypes controls =
item->controlTypes(
top);
1432 lastRowAdHocData.q_hasButtons =
true;
1434 lastRowAdHocData.q_hasNonButtons =
true;
1458 bool lastRowIsButtonBox = (lastRowAdHocData.hasOnlyButtons()
1459 && nextToLastRowAdHocData.hasOnlyNonButtons());
1460 bool lastTwoRowsIsButtonBox = (lastRowAdHocData.hasOnlyButtons()
1461 && nextToLastRowAdHocData.hasOnlyButtons()
1462 && nextToNextToLastRowAdHocData.hasOnlyNonButtons()
1477 if (item1 && item2 && item1 != item2) {
1482 if ((
row == nextToLastRowAdHocData.q_row && lastTwoRowsIsButtonBox)
1483 || (
row == lastRowAdHocData.q_row && lastRowIsButtonBox)) {
1518 }
else if (lastRowIsButtonBox || lastTwoRowsIsButtonBox) {
1524 int prevRow = lastRowIsButtonBox ? nextToLastRowAdHocData.q_row
1525 : nextToNextToLastRowAdHocData.q_row;
1535 (orientation ==
Qt::Vertical && m_uniformCellHeights))) {
1536 qreal averagePreferredSize = 0.;
1537 qreal minimumMaximumSize = std::numeric_limits<qreal>::max();
1538 qreal maximumMinimumSize = 0.;
1539 for (
const auto &
box : rowData->boxes) {
1540 averagePreferredSize +=
box.q_preferredSize;
1541 minimumMaximumSize =
qMin(minimumMaximumSize,
box.q_maximumSize);
1542 maximumMinimumSize =
qMax(maximumMinimumSize,
box.q_minimumSize);
1544 averagePreferredSize /= rowData->
boxes.
size();
1545 minimumMaximumSize =
qMax(minimumMaximumSize, maximumMinimumSize);
1546 averagePreferredSize =
qBound(maximumMinimumSize, averagePreferredSize, minimumMaximumSize);
1547 for (
auto &
box : rowData->boxes) {
1548 box.q_preferredSize = averagePreferredSize;
1549 box.q_minimumSize = maximumMinimumSize;
1550 box.q_maximumSize = minimumMaximumSize;
1555void QGridLayoutEngine::ensureEffectiveFirstAndLastRows()
const
1562 q_cachedEffectiveLastRows = {-1, -1};
1568 if (
item->firstRow(
o) < q_cachedEffectiveFirstRows[
o])
1569 q_cachedEffectiveFirstRows[
o] =
item->firstRow(
o);
1570 if (
item->lastRow(
o) > q_cachedEffectiveLastRows[
o])
1571 q_cachedEffectiveLastRows[
o] =
item->lastRow(
o);
1578 const qreal *colPositions,
const qreal *colSizes,
1584 const qreal constraint = (colPositions && colSizes &&
hasDynamicConstraint()) ? (colPositions[cc - 1] + colSizes[cc - 1]) :
qreal(CachedWithNoConstraint);
1585 qreal &cachedConstraint = q_totalBoxCachedConstraints[orientation];
1586 if (cachedConstraint == constraint) {
1587 if (totalBox != &q_totalBoxes[orientation])
1588 *totalBox = q_totalBoxes[orientation];
1592 fillRowData(rowData, colPositions, colSizes, orientation, styleInfo);
1597 if (totalBox != &q_totalBoxes[orientation])
1598 q_totalBoxes[orientation] = *totalBox;
1600 cachedConstraint = constraint;
1612 if (
item->hasDynamicConstraint()) {
1615 q_cachedConstraintOrientation = itemConstraintOrientation;
1616 }
else if (q_cachedConstraintOrientation != itemConstraintOrientation) {
1618 qWarning(
"QGridLayoutEngine: Unfeasible, cannot mix horizontal and"
1619 " vertical constraint in the same layout");
1646void QGridLayoutEngine::ensureGeometries(
const QSizeF &
size,
1649 if (q_cachedSize ==
size)
1652 q_cachedSize =
size;
virtual qreal windowMargin(Qt::Orientation orientation) const =0
virtual qreal spacing(Qt::Orientation orientation) const =0
virtual qreal combinedLayoutSpacing(QLayoutPolicy::ControlTypes, QLayoutPolicy::ControlTypes, Qt::Orientation) const
bool testBit(qsizetype i) const
Returns true if the bit at index position i is 1; otherwise returns false.
qsizetype count() const
Same as size().
void setBit(qsizetype i)
Sets the bit at index position i to 1.
bool fill(bool val, qsizetype size=-1)
Sets every bit in the bit array to value, returning true if successful; otherwise returns false.
void combine(const QGridLayoutBox &other)
void add(const QGridLayoutBox &other, int stretch, qreal spacing)
qreal & q_sizes(int which)
void setRowStretchFactor(int row, int stretch, Qt::Orientation orientation=Qt::Vertical)
void setVisualDirection(Qt::LayoutDirection direction)
void removeItem(QGridLayoutItem *item)
QGridLayoutItem * itemAt(int index) const
void setRowAlignment(int row, Qt::Alignment alignment, Qt::Orientation orientation)
Qt::Alignment effectiveAlignment(const QGridLayoutItem *layoutItem) const
int effectiveFirstRow(Qt::Orientation orientation=Qt::Vertical) const
void setUniformCellHeights(bool uniformCellHeights)
Qt::Orientation constraintOrientation() const
bool uniformCellWidths() const
void setRowSizeHint(Qt::SizeHint which, int row, qreal size, Qt::Orientation orientation=Qt::Vertical)
QList< QGridLayoutItem * > q_items
bool ensureDynamicConstraint() const
int rowStretchFactor(int row, Qt::Orientation orientation=Qt::Vertical) const
QRectF cellRect(const QRectF &contentsGeometry, int row, int column, int rowSpan, int columnSpan, const QAbstractLayoutStyleInfo *styleInfo) const
int effectiveLastRow(Qt::Orientation orientation=Qt::Vertical) const
void setSpacing(qreal spacing, Qt::Orientations orientations)
void insertItem(QGridLayoutItem *item, int index)
void setRowSpacing(int row, qreal spacing, Qt::Orientation orientation=Qt::Vertical)
bool uniformCellHeights() const
QLayoutPolicy::ControlTypes controlTypes(LayoutSide side) const
void setUniformCellWidths(bool uniformCellWidths)
qreal spacing(Qt::Orientation orientation, const QAbstractLayoutStyleInfo *styleInfo) const
QGridLayoutEngine(Qt::Alignment defaultAlignment={ }, bool snapToPixelGrid=false)
Qt::LayoutDirection visualDirection() const
QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint, const QAbstractLayoutStyleInfo *styleInfo) const
qreal rowSpacing(int row, Qt::Orientation orientation=Qt::Vertical) const
void addItem(QGridLayoutItem *item)
bool hasDynamicConstraint() const
void setGeometries(const QRectF &contentsGeometry, const QAbstractLayoutStyleInfo *styleInfo)
qreal rowSizeHint(Qt::SizeHint which, int row, Qt::Orientation orientation=Qt::Vertical) const
Qt::Alignment rowAlignment(int row, Qt::Orientation orientation) const
QRectF geometryWithin(qreal x, qreal y, qreal width, qreal height, qreal rowDescent, Qt::Alignment align, bool snapToPixelGrid) const
void setFirstRow(int row, Qt::Orientation orientation=Qt::Vertical)
void setRowSpan(int rowSpan, Qt::Orientation orientation=Qt::Vertical)
Qt::Alignment alignment() const
void insertOrRemoveRows(int row, int delta, Qt::Orientation orientation=Qt::Vertical)
virtual bool hasDynamicConstraint() const
void setStretchFactor(int stretch, Qt::Orientation orientation)
virtual QLayoutPolicy::Policy sizePolicy(Qt::Orientation orientation) const =0
int stretchFactor(Qt::Orientation orientation) const
QGridLayoutBox box(Qt::Orientation orientation, bool snapToPixelGrid, qreal constraint=-1.0) const
virtual Qt::Orientation dynamicConstraintOrientation() const
QSizeF effectiveMaxSize(const QSizeF &constraint) const
QGridLayoutItem(int row, int column, int rowSpan=1, int columnSpan=1, Qt::Alignment alignment={ })
virtual QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const =0
virtual QLayoutPolicy::ControlTypes controlTypes(LayoutSide side) const
QList< QGridLayoutBox > boxes
QGridLayoutBox totalBox(int start, int end) const
void stealBox(int start, int end, int which, qreal *positions, qreal *sizes)
void calculateGeometries(int start, int end, qreal targetSize, qreal *positions, qreal *sizes, qreal *descents, const QGridLayoutBox &totalBox, const QGridLayoutRowInfo &rowInfo, bool snapToPixelGrid)
MultiCellMap multiCellMap
void distributeMultiCells(const QGridLayoutRowInfo &rowInfo, bool snapToPixelGrid)
QList< QLayoutParameter< qreal > > spacings
QList< QGridLayoutBox > boxes
QList< Qt::Alignment > alignments
QList< QStretchParameter > stretches
void insertOrRemoveRows(int row, int delta)
constexpr T & other(Qt::Orientation o) noexcept
constexpr void transpose() noexcept
constexpr QHVContainer transposed() const noexcept(std::is_nothrow_copy_constructible_v< T >)
void setCachedValue(T value) const
qsizetype size() const noexcept
QList< T > & fill(parameter_type t, qsizetype size=-1)
bool isEmpty() const noexcept
iterator insert(qsizetype i, parameter_type t)
const_reference at(qsizetype i) const noexcept
T value(qsizetype i) const
void remove(qsizetype i, qsizetype n=1)
qsizetype removeAll(const AT &t)
qsizetype count() const noexcept
void resize(qsizetype size)
void append(parameter_type t)
const_iterator constBegin() const
const_iterator constEnd() const
\inmodule QtCore\reentrant
constexpr qreal y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr qreal height() const noexcept
Returns the height of the rectangle.
constexpr qreal width() const noexcept
Returns the width of the rectangle.
constexpr qreal x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr void moveRight(qreal pos) noexcept
Moves the rectangle horizontally, leaving the rectangle's right edge at the given finite x coordinate...
constexpr qreal left() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr void moveLeft(qreal pos) noexcept
Moves the rectangle horizontally, leaving the rectangle's left edge at the given finite x coordinate.
constexpr QSizeF size() const noexcept
Returns the size of the rectangle.
constexpr void moveTop(qreal pos) noexcept
Moves the rectangle vertically, leaving the rectangle's top line at the given finite y coordinate.
constexpr qreal right() const noexcept
Returns the x-coordinate of the rectangle's right edge.
constexpr qreal width() const noexcept
Returns the width.
constexpr qreal height() const noexcept
Returns the height.
\macro QT_RESTRICTED_CAST_FROM_ASCII
QString rightJustified(qsizetype width, QChar fill=u' ', bool trunc=false) const
Returns a string of size() width that contains the fill character followed by the string.
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString arg(qlonglong a, int fieldwidth=0, int base=10, QChar fillChar=u' ') const
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QSet< QString >::iterator it
Combined button and popup list for selecting options.
static const QCssKnownValue positions[NumKnownPositionModes - 1]
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
static void insertOrRemoveItems(QList< T > &items, int index, int delta)
static qreal growthFactorBelowPreferredSize(qreal desired, qreal sumAvailable, qreal sumDesired)
static void visualRect(QRectF *geom, Qt::LayoutDirection dir, const QRectF &contentsRect)
static qreal fixedDescent(qreal descent, qreal ascent, qreal targetSize)
bool operator==(const QGridLayoutBox &box1, const QGridLayoutBox &box2)
static qreal compare(const QGridLayoutBox &box1, const QGridLayoutBox &box2, int which)
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qBound(const T &min, const T &val, const T &max)
constexpr const T & qMax(const T &a, const T &b)
GLint GLint GLint GLint GLint x
[0]
GLint GLsizei GLsizei height
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLuint GLenum GLsizei length
GLdouble GLdouble GLdouble GLdouble top
GLenum GLenum GLsizei count
GLuint GLsizei const GLchar * message
GLenum GLuint GLintptr offset
GLsizei const GLint * box
GLenum GLenum GLsizei void GLsizei void * column
GLuint GLsizei const GLuint const GLintptr const GLsizeiptr * sizes
GLenum GLenum GLsizei void * row
GLenum GLenum GLsizei void GLsizei void void * span
GLfloat GLfloat GLfloat alpha
constexpr decltype(auto) qMakePair(T1 &&value1, T2 &&value2) noexcept(noexcept(std::make_pair(std::forward< T1 >(value1), std::forward< T2 >(value2))))
static void layoutItem(QQuickItem *item, qreal y, qreal width)
#define qPrintable(string)
static QT_BEGIN_NAMESPACE void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharAttributes *attributes)
static int compare(quint64 a, quint64 b)
qsizetype indexOf(const AT &t, qsizetype from=0) const noexcept
bool contains(const AT &t) const noexcept