291 QSizePolicy::ControlTypes controlTypes1;
292 QSizePolicy::ControlTypes controlTypes2;
293 int fixedSpacing = q->spacing();
294 int previousNonEmptyIndex = -1;
297 if (fixedSpacing < 0) {
302 for (
int i = 0; i < n; i++) {
312 if (fixedSpacing >= 0) {
313 spacing = (previousNonEmptyIndex >= 0) ? fixedSpacing : 0;
315 if (!
horz(
dir) && previousNonEmptyIndex >= 0) {
325 controlTypes1 = controlTypes2;
327 if (previousNonEmptyIndex >= 0) {
328 QSizePolicy::ControlTypes actual1 = controlTypes1;
329 QSizePolicy::ControlTypes actual2 = controlTypes2;
331 qSwap(actual1, actual2);
336 0, q->parentWidget());
343 if (previousNonEmptyIndex >= 0)
344 a[previousNonEmptyIndex].spacing =
spacing;
345 previousNonEmptyIndex = i;
352 horexp = horexp || expand;
353 maxw += spacing + max.
width();
354 minw += spacing + min.
width();
355 hintw += spacing + hint.
width();
362 a[i].sizeHint = hint.
width();
363 a[i].maximumSize = max.
width();
364 a[i].minimumSize = min.
width();
365 a[i].expansive = expand;
368 bool expand = (exp & Qt::Vertical || box->
stretch > 0);
369 verexp = verexp || expand;
370 maxh += spacing + max.
height();
371 minh += spacing + min.
height();
372 hinth += spacing + hint.
height();
380 a[i].maximumSize = max.
height();
381 a[i].minimumSize = min.
height();
382 a[i].expansive = expand;
394 ((horexp ? Qt::Horizontal : 0)
404 QSize extra(left + right, top + bottom);
void effectiveMargins(int *left, int *top, int *right, int *bottom) const
The QBoxLayout class lines up child widgets horizontally or vertically.
virtual QRect geometry() const =0
Returns the rectangle covered by this layout item.
QList< QBoxLayoutItem * > list
virtual bool isEmpty() const =0
Implemented in subclasses to return whether this item is empty, i.
QVector< QLayoutStruct > geomArray
virtual Qt::Orientations expandingDirections() const =0
Returns whether this layout item can make use of more space than sizeHint().
QSizePolicy::ControlTypes controlTypes() const
Returns the control type(s) for the layout item.
QSize expandedTo(const QSize &) const
Returns a size holding the maximum width and height of this size and the given otherSize.
static bool ignore(const char *test, const char *const *table)
Qt::Orientations expanding
long ASN1_INTEGER_get ASN1_INTEGER * a
int count(const T &t) const
Returns the number of occurrences of value in the list.
virtual QSize minimumSize() const =0
Implemented in subclasses to return the minimum size of this item.
virtual bool hasHeightForWidth() const
Returns true if this layout's preferred height depends on its width; otherwise returns false...
QSize boundedTo(const QSize &) const
Returns a size holding the minimum width and height of this size and the given otherSize.
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
int width() const
Returns the width.
void clear()
Removes all the elements from the vector and releases the memory used by the vector.
const T & at(int i) const
Returns the item at index position i in the list.
static bool horz(QBoxLayout::Direction dir)
QBoxLayout::Direction dir
void qSwap(T &value1, T &value2)
static QWidget * parentWidget(const QWidget *w)
int top() const
Returns the y-coordinate of the rectangle's top edge.
virtual QSize sizeHint() const =0
Implemented in subclasses to return the preferred size of this item.
virtual QSize maximumSize() const =0
Implemented in subclasses to return the maximum size of this item.
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI...
int height() const
Returns the height.
virtual QWidget * widget()
If this item is a QWidget, it is returned as a QWidget; otherwise 0 is returned.
The QSize class defines the size of a two-dimensional object using integer point precision.
static const int QLAYOUTSIZE_MAX
static void qMaxExpCalc(int &max, bool &exp, bool &empty, int boxmax, bool boxexp, bool boxempty)
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
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.