44 #if QT_CONFIG(menubar)
47 #if QT_CONFIG(toolbar)
455 ? fromLayoutItemRect(
wid->d_func(),
rect)
457 const QSize widgetRectSurplus =
r.size() -
rect.size();
480 pref += widgetRectSurplus;
485 s.setHeight(qMin(
s.height(),
487 + widgetRectSurplus.
height()));
489 s.setHeight(qMin(
s.height(), pref.
height()));
494 x =
x + (
r.width() -
s.width());
496 x =
x + (
r.width() -
s.width()) / 2;
499 y =
y + (
r.height() -
s.height());
501 y =
y + (
r.height() -
s.height()) / 2;
566 if (hfw < wid->minimumHeight())
595 if (hfw < wid->minimumHeight())
708 ? toLayoutItemSize(
wid->d_func(),
s)
753 inline bool QWidgetItemV2::useSizeCache()
const
755 return wid->d_func()->widgetItem ==
this;
758 void QWidgetItemV2::updateCacheIfNecessary()
const
760 if (q_cachedMinimumSize.
width() != Dirty)
775 q_cachedMinimumSize = useLayoutItemRect
776 ? toLayoutItemSize(
wid->d_func(), smartMinSize)
779 q_cachedSizeHint = expandedSizeHint;
782 q_cachedSizeHint = useLayoutItemRect
783 ? toLayoutItemSize(
wid->d_func(), q_cachedSizeHint)
791 q_cachedMaximumSize = useLayoutItemRect
792 ? toLayoutItemSize(
wid->d_func(), smartMaxSize)
798 q_cachedMinimumSize(Dirty, Dirty),
799 q_cachedSizeHint(Dirty, Dirty),
800 q_cachedMaximumSize(Dirty, Dirty),
814 if (wd->widgetItem ==
this)
824 if (useSizeCache()) {
825 updateCacheIfNecessary();
826 return q_cachedSizeHint;
837 if (useSizeCache()) {
838 updateCacheIfNecessary();
839 return q_cachedMinimumSize;
850 if (useSizeCache()) {
851 updateCacheIfNecessary();
852 return q_cachedMaximumSize;
878 for (
int i = 0;
i < q_hfwCacheSize; ++
i) {
879 int offset = q_firstCachedHfw +
i;
882 if (q_hfwCacheSize == HfwCacheMaxSize)
883 q_firstCachedHfw =
offset % HfwCacheMaxSize;
884 return size.height();
888 if (q_hfwCacheSize < HfwCacheMaxSize)
890 q_firstCachedHfw = (q_firstCachedHfw + HfwCacheMaxSize - 1) % HfwCacheMaxSize;
small capitals from c petite p scientific i
[1]
The QLayout class is the base class of geometry managers.
int totalHeightForWidth(int w) const
int totalMinimumHeightForWidth(int w) const
Qt::Orientations expandingDirections() const override
QLayout * layout() override
virtual QSizePolicy::ControlTypes controlTypes() const
virtual bool hasHeightForWidth() const
virtual int heightForWidth(int) const
virtual QLayout * layout()
Qt::Alignment alignment() const
virtual QSpacerItem * spacerItem()
virtual int minimumHeightForWidth(int) const
virtual QWidget * widget() const
virtual void invalidate()
void setAlignment(Qt::Alignment a)
static QObjectPrivate * get(QObject *o)
The QPoint class defines a point in the plane using integer precision.
The QRect class defines a rectangle in the plane using integer precision.
constexpr QSize size() const noexcept
The QSize class defines the size of a two-dimensional object using integer point precision.
constexpr QSize boundedTo(const QSize &) const noexcept
constexpr int height() const noexcept
constexpr int width() const noexcept
constexpr QSize expandedTo(const QSize &) const noexcept
constexpr void setWidth(int w) noexcept
constexpr void setHeight(int h) noexcept
The QSizePolicy class is a layout attribute describing horizontal and vertical resizing policy.
constexpr Policy verticalPolicy() const noexcept
ControlType controlType() const noexcept
constexpr bool retainSizeWhenHidden() const noexcept
constexpr Qt::Orientations expandingDirections() const noexcept
constexpr Policy horizontalPolicy() const noexcept
The QSpacerItem class provides blank space in a layout.
QSize sizeHint() const override
QRect geometry() const override
bool isEmpty() const override
QSpacerItem * spacerItem() override
QSize minimumSize() const override
void setGeometry(const QRect &) override
Qt::Orientations expandingDirections() const override
QSize maximumSize() const override
void changeSize(int w, int h, QSizePolicy::Policy hData=QSizePolicy::Minimum, QSizePolicy::Policy vData=QSizePolicy::Minimum)
static Qt::Alignment visualAlignment(Qt::LayoutDirection direction, Qt::Alignment alignment)
union Alignment_ Alignment
@ WA_LayoutUsesWidgetRect
const char * sizePolicy(int v)
Q_WIDGETS_EXPORT QSize qSmartMinSize(const QSize &sizeHint, const QSize &minSizeHint, const QSize &minSize, const QSize &maxSize, const QSizePolicy &sizePolicy)
Q_WIDGETS_EXPORT QSize qSmartMaxSize(const QSize &sizeHint, const QSize &minSize, const QSize &maxSize, const QSizePolicy &sizePolicy, Qt::Alignment align)
constexpr QT_BEGIN_NAMESPACE int QLAYOUTSIZE_MAX
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLint GLsizei GLsizei height
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLuint GLintptr offset
GLfloat GLfloat GLfloat GLfloat h