7#include <QtWidgets/qtwidgetsglobal.h>
8#include <QtCore/qobject.h>
9#include <QtCore/qalgorithms.h>
10#include <QtCore/qhashfunctions.h>
33 Preferred = GrowFlag | ShrinkFlag,
34 MinimumExpanding = GrowFlag | ExpandFlag,
35 Expanding = GrowFlag | ShrinkFlag | ExpandFlag,
36 Ignored = ShrinkFlag | GrowFlag | IgnoreFlag
41 DefaultType = 0x00000001,
42 ButtonBox = 0x00000002,
43 CheckBox = 0x00000004,
44 ComboBox = 0x00000008,
46 GroupBox = 0x00000020,
49 LineEdit = 0x00000100,
50 PushButton = 0x00000200,
51 RadioButton = 0x00000400,
54 TabWidget = 0x00002000,
55 ToolButton = 0x00004000
64 type == DefaultType ? 0 : toControlTypeFieldValue(
type), 0, 0, 0}
68 ControlType controlType() const noexcept;
70 constexpr
void setHorizontalPolicy(
Policy d) noexcept {
bits.horPolicy =
d; }
72 void setControlType(ControlType
type)
noexcept;
76 return ( (verticalPolicy() &
static_cast<Policy>(ExpandFlag)) ?
Qt::Vertical : Qt::Orientations() )
77 | ( (horizontalPolicy() &
static_cast<Policy>(ExpandFlag)) ?
Qt::Horizontal : Qt::Orientations() ) ;
100 constexpr void transpose() noexcept { *
this = transposed(); }
107#ifndef QT_NO_DATASTREAM
115 static constexpr quint32 toControlTypeFieldValue(ControlType
type)
noexcept
142 quint32 retainSizeWhenHidden : 1;
144 constexpr Bits transposed() const noexcept
153 retainSizeWhenHidden};
167#ifndef QT_NO_DATASTREAM
172#ifndef QT_NO_DEBUG_STREAM
\inmodule QtCore\reentrant
The QSizePolicy class is a layout attribute describing horizontal and vertical resizing policy.
constexpr Policy verticalPolicy() const noexcept
Returns the vertical component of the size policy.
constexpr QSizePolicy transposed() const noexcept
constexpr QSizePolicy(Policy horizontal, Policy vertical, ControlType type=DefaultType) noexcept
constexpr bool hasWidthForHeight() const noexcept
Returns true if the widget's width depends on its height; otherwise returns false.
constexpr void setWidthForHeight(bool b) noexcept
Sets the flag determining whether the widget's width depends on its height, to dependent.
constexpr bool retainSizeWhenHidden() const noexcept
constexpr void transpose() noexcept
Swaps the horizontal and vertical policies and stretches.
PolicyFlag
These flags are combined together to form the various \l{Policy} values:
constexpr Qt::Orientations expandingDirections() const noexcept
Returns whether a widget can make use of more space than the QWidget::sizeHint() function indicates.
constexpr Policy horizontalPolicy() const noexcept
Returns the horizontal component of the size policy.
friend Q_DECL_CONST_FUNCTION size_t qHash(QSizePolicy key, size_t seed=0) noexcept
constexpr void setVerticalStretch(int stretchFactor)
Sets the vertical stretch factor of the size policy to the given stretchFactor.
constexpr bool hasHeightForWidth() const noexcept
Returns true if the widget's preferred height depends on its width; otherwise returns false.
constexpr void setVerticalPolicy(Policy d) noexcept
Sets the vertical component to the given policy.
constexpr bool operator==(const QSizePolicy &s) const noexcept
Returns true if this policy is equal to other; otherwise returns false.
constexpr bool operator!=(const QSizePolicy &s) const noexcept
Returns true if this policy is different from other; otherwise returns false.
constexpr void setHorizontalStretch(int stretchFactor)
Sets the horizontal stretch factor of the size policy to the given stretchFactor.
constexpr int horizontalStretch() const noexcept
Returns the horizontal stretch factor of the size policy.
constexpr void setRetainSizeWhenHidden(bool retainSize) noexcept
Policy
This enum describes the various per-dimension sizing types used when constructing a QSizePolicy.
constexpr int verticalStretch() const noexcept
Returns the vertical stretch factor of the size policy.
constexpr void setHeightForWidth(bool b) noexcept
Sets the flag determining whether the widget's preferred height depends on its width,...
Combined button and popup list for selecting options.
constexpr uint qCountTrailingZeroBits(quint32 v) noexcept
#define Q_DECL_CONST_FUNCTION
#define Q_DECLARE_FLAGS(Flags, Enum)
#define Q_DECLARE_MIXED_ENUM_OPERATORS(Ret, Flags, Enum)
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
constexpr const T & qBound(const T &min, const T &val, const T &max)
GLboolean GLboolean GLboolean b
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const void * bits
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
Q_WIDGETS_EXPORT QDataStream & operator>>(QDataStream &, QSizePolicy &)
Q_WIDGETS_EXPORT QDataStream & operator<<(QDataStream &, const QSizePolicy &)
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)