455 QSizePolicy::ControlTypes
types;
502 pref.
setWidth(wid->sizeHint().expandedTo(wid->minimumSize()).width());
504 pref.
setHeight(wid->sizeHint().expandedTo(wid->minimumSize()).height());
505 pref += widgetRectSurplus;
512 + widgetRectSurplus.height()));
557 return wid->d_func()->hasHeightForWidth();
574 hfw = wid->layout()->totalHeightForWidth(w);
576 hfw = wid->heightForWidth(w);
578 if (hfw > wid->maximumHeight())
579 hfw = wid->maximumHeight();
580 if (hfw < wid->minimumHeight())
581 hfw = wid->minimumHeight();
597 return sizeP.expandingDirections();
606 return Qt::Orientations(0);
608 Qt::Orientations e = wid->sizePolicy().expandingDirections();
620 && (wid->layout()->expandingDirections() &
Qt::Vertical))
680 return QSize(width, height);
690 s = wid->sizeHint().
expandedTo(wid->minimumSizeHint());
692 .expandedTo(wid->minimumSize());
720 return wid->isHidden() || wid->isWindow();
730 return wid->d_func()->widgetItem ==
this;
735 if (q_cachedMinimumSize.width() != Dirty)
739 const QSize minimumSizeHint(wid->minimumSizeHint());
750 q_cachedMinimumSize = useLayoutItemRect
754 q_cachedSizeHint = expandedSizeHint;
757 q_cachedSizeHint = useLayoutItemRect
764 q_cachedSizeHint.setHeight(0);
766 q_cachedMaximumSize = useLayoutItemRect
773 q_cachedMinimumSize(Dirty, Dirty),
774 q_cachedSizeHint(Dirty, Dirty),
775 q_cachedMaximumSize(Dirty, Dirty),
856 if (size.
width() == width) {
The QVariant class acts like a union for the most common Qt data types.
virtual QLayoutItem * itemAt(int index) const =0
Must be implemented in subclasses to return the layout item at index.
QSize sizeHint() const
Reimplemented Function
QRect adjusted(int x1, int y1, int x2, int y2) const
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
#define QT_END_NAMESPACE
This macro expands to.
Q_GUI_EXPORT QSize qSmartMinSize(const QSize &sizeHint, const QSize &minSizeHint, const QSize &minSize, const QSize &maxSize, const QSizePolicy &sizePolicy)
virtual ~QLayoutItem()
Destroys the QLayoutItem.
Qt::Orientations expandingDirections() const
Reimplemented Function
virtual bool isEmpty() const =0
Implemented in subclasses to return whether this item is empty, i.
Q_GUI_EXPORT QSize qSmartMaxSize(const QSize &sizeHint, const QSize &minSize, const QSize &maxSize, const QSizePolicy &sizePolicy, Qt::Alignment align)
Policy horizontalPolicy() const
virtual void invalidate()
Invalidates any cached information in this layout item.
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.
int width() const
Returns the width of the rectangle.
virtual int minimumHeightForWidth(int) const
Returns the minimum height this widget needs for the given width, w.
int height() const
Returns the height of the rectangle.
virtual QSize minimumSize() const =0
Implemented in subclasses to return the minimum size of this item.
void setHeight(int h)
Sets the height to the given height.
virtual bool hasHeightForWidth() const
Returns true if this layout's preferred height depends on its width; otherwise returns false...
static QRect toLayoutItemRect(QWidgetPrivate *priv, const QRect &rect)
QRect geometry() const
Reimplemented Function
QSpacerItem * spacerItem()
Returns a pointer to this object.
QSize boundedTo(const QSize &) const
Returns a size holding the minimum width and height of this size and the given otherSize.
virtual QSpacerItem * spacerItem()
If this item is a QSpacerItem, it is returned as a QSpacerItem; otherwise 0 is returned.
QSize maximumSize() const
Reimplemented Function
void setWidth(int w)
Sets the width to the given width.
int width() const
Returns the width.
QSize minimumSize() const
Reimplemented Function
void setAlignment(Qt::Alignment a)
Sets the alignment of this item to alignment.
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QSpacerItem class provides blank space in a layout.
The QLayout class is the base class of geometry managers.
static QSize toLayoutItemSize(QWidgetPrivate *priv, const QSize &size)
QSize size() const
Returns the size of the rectangle.
void setGeometry(const QRect &)
Reimplemented Function
static Qt::Alignment visualAlignment(Qt::LayoutDirection direction, Qt::Alignment alignment)
Transforms an alignment of Qt::AlignLeft or Qt::AlignRight without Qt::AlignAbsolute into Qt::AlignLe...
static QRect fromLayoutItemRect(QWidgetPrivate *priv, const QRect &rect)
virtual int count() const =0
Must be implemented in subclasses to return the number of items in the layout.
int y() const
Returns the y-coordinate of the rectangle's top edge.
bool isEmpty() const
Returns true.
virtual QSize sizeHint() const =0
Implemented in subclasses to return the preferred size of this item.
virtual QLayout * layout()
If this item is a QLayout, it is returned as a QLayout; otherwise 0 is returned.
int x() const
Returns the x-coordinate of the rectangle's left edge.
virtual QSize maximumSize() const =0
Implemented in subclasses to return the maximum size of this item.
The QPoint class defines a point in the plane using integer precision.
Policy verticalPolicy() const
int height() const
Returns the height.
The QRect class defines a rectangle in the plane using integer precision.
Qt::Alignment alignment() const
Returns the alignment of this item.
virtual QWidget * widget()
If this item is a QWidget, it is returned as a QWidget; otherwise 0 is returned.
virtual int heightForWidth(int) const
Returns the preferred height for this layout item, given the width w.
The QSize class defines the size of a two-dimensional object using integer point precision.
static QSize fromLayoutItemSize(QWidgetPrivate *priv, const QSize &size)
QLayout * layout()
Reimplemented Function
static const int QLAYOUTSIZE_MAX
ControlType controlType() const
void changeSize(int w, int h, QSizePolicy::Policy hData=QSizePolicy::Minimum, QSizePolicy::Policy vData=QSizePolicy::Minimum)
Changes this spacer item to have preferred width w, preferred height h, horizontal size policy hPolic...