22#define COMBINE_SIZE(result, size) \
24 if ((result).width() < 0 || (result).height() < 0) \
25 combineSize((result), (size)); \
54 if (minimum >= 0 && maximum >= 0 && minimum > maximum)
58 if (minimum >= 0 && preferred < minimum) {
60 }
else if (maximum >= 0 && preferred > maximum) {
65 if (minimum >= 0 && descent > minimum)
102 const bool hasConstraint = constraint.
width() >= 0 || constraint.
height() >= 0;
114 sizeHintCache[
i] = constraint;
154 return sizeHintCache;
209 }
else if (
size.width() < 0 &&
size.height() < 0) {
231 if (
value == userValue)
243 for (
int i = l->
count() - 1;
i >= 0; --
i) {
255 return q->sizePolicy().hasHeightForWidth();
263 for (
int i = l->
count() - 1;
i >= 0; --
i) {
275 return q->sizePolicy().hasWidthForHeight();
380 if (parentLI && parentLI->
isLayout()) {
383 for (
int i = lay->
count() - 1;
i >= 0; --
i) {
449 return d->sizePolicy;
771 if (!
d->userSizeHints && constraint.
isValid())
789 d->sizeHintCacheDirty =
true;
790 d->sizeHintWithConstraintCacheDirty =
true;
806 bool isHidden =
false;
823 return d_func()->parent;
833 d_func()->parent =
parent;
845 return d_func()->isLayout;
874 return d_func()->ownedByLayout;
885 d_func()->ownedByLayout = ownership;
897 return d_func()->graphicsItem;
912 d_func()->graphicsItem =
item;
static const QGraphicsItemPrivate * get(const QGraphicsItem *item)
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
QSizeF * effectiveSizeHints(const QSizeF &constraint) const
void ensureUserSizeHints()
bool hasWidthForHeight() const
void setSizeComponent(Qt::SizeHint which, SizeComponent component, qreal value)
void setSize(Qt::SizeHint which, const QSizeF &size)
QGraphicsLayoutItem * parent
virtual ~QGraphicsLayoutItemPrivate()
QGraphicsLayoutItemPrivate(QGraphicsLayoutItem *parent, bool isLayout)
quint32 sizeHintCacheDirty
quint32 sizeHintWithConstraintCacheDirty
static QGraphicsLayoutItemPrivate * get(QGraphicsLayoutItem *q)
QGraphicsItem * parentItem() const
QSizeF cachedSizeHints[Qt::NSizeHints]
QSizeF cachedSizeHintsWithConstraints[Qt::NSizeHints]
bool hasHeightForWidth() const
The QGraphicsLayoutItem class can be inherited to allow your custom items to be managed by layouts.
void setPreferredWidth(qreal width)
Sets the preferred width to width.
void setMaximumWidth(qreal width)
Sets the maximum width to width.
void setGraphicsItem(QGraphicsItem *item)
If the QGraphicsLayoutItem represents a QGraphicsItem, and it wants to take advantage of the automati...
QGraphicsItem * graphicsItem() const
Returns the QGraphicsItem that this layout item represents.
QSizeF effectiveSizeHint(Qt::SizeHint which, const QSizeF &constraint=QSizeF()) const
Returns the effective size hint for this QGraphicsLayoutItem.
QScopedPointer< QGraphicsLayoutItemPrivate > d_ptr
void setMaximumSize(const QSizeF &size)
Sets the maximum size to size.
void setSizePolicy(const QSizePolicy &policy)
Sets the size policy to policy.
void setOwnedByLayout(bool ownedByLayout)
virtual void updateGeometry()
This virtual function discards any cached size hint information.
virtual bool isEmpty() const
QRectF geometry() const
Returns the item's geometry (e.g., position and size) as a QRectF.
bool isLayout() const
Returns true if this QGraphicsLayoutItem is a layout (e.g., is inherited by an object that arranges o...
bool ownedByLayout() const
void setPreferredHeight(qreal height)
Sets the preferred height to height.
void setPreferredSize(const QSizeF &size)
Sets the preferred size to size.
QGraphicsLayoutItem * parentLayoutItem() const
Returns the parent of this QGraphicsLayoutItem, or \nullptr if there is no parent,...
void setMinimumSize(const QSizeF &size)
Sets the minimum size to size.
void setMaximumHeight(qreal height)
Sets the maximum height to height.
void setParentLayoutItem(QGraphicsLayoutItem *parent)
Sets the parent of this QGraphicsLayoutItem to parent.
virtual void getContentsMargins(qreal *left, qreal *top, qreal *right, qreal *bottom) const
This virtual function provides the left, top, right and bottom contents margins for this QGraphicsLay...
QRectF contentsRect() const
Returns the contents rect in local coordinates.
QSizeF minimumSize() const
Returns the minimum size.
virtual void setGeometry(const QRectF &rect)
This virtual function sets the geometry of the QGraphicsLayoutItem to rect, which is in parent coordi...
virtual ~QGraphicsLayoutItem()
Destroys the QGraphicsLayoutItem object.
QSizePolicy sizePolicy() const
Returns the current size policy.
QSizeF preferredSize() const
Returns the preferred size.
QSizeF maximumSize() const
Returns the maximum size.
void setMinimumWidth(qreal width)
Sets the minimum width to width.
void setMinimumHeight(qreal height)
Sets the minimum height to height.
QGraphicsLayoutItem(QGraphicsLayoutItem *parent=nullptr, bool isLayout=false)
Constructs the QGraphicsLayoutItem object.
The QGraphicsLayout class provides the base class for all layouts in Graphics View.
virtual int count() const =0
This pure virtual function must be reimplemented in a subclass of QGraphicsLayout to return the numbe...
virtual QGraphicsLayoutItem * itemAt(int i) const =0
This pure virtual function must be reimplemented in a subclass of QGraphicsLayout to return a pointer...
virtual void removeAt(int index)=0
This pure virtual function must be reimplemented in a subclass of QGraphicsLayout to remove the item ...
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
constexpr QRectF adjusted(qreal x1, qreal y1, qreal x2, qreal y2) const noexcept
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
constexpr qreal & rwidth() noexcept
Returns a reference to the width.
constexpr bool isValid() const noexcept
Returns true if both the width and height are equal to or greater than 0; otherwise returns false.
constexpr qreal & rheight() noexcept
Returns a reference to the height.
constexpr qreal width() const noexcept
Returns the width.
constexpr qreal height() const noexcept
Returns the height.
The QSizePolicy class is a layout attribute describing horizontal and vertical resizing policy.
constexpr bool retainSizeWhenHidden() const noexcept
Policy
This enum describes the various per-dimension sizing types used when constructing a QSizePolicy.
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define COMBINE_SIZE(result, size)
static void normalizeHints(qreal &minimum, qreal &preferred, qreal &maximum, qreal &descent)
static void boundSize(QSizeF &result, const QSizeF &size)
static void combineSize(QSizeF &result, const QSizeF &size)
static void expandSize(QSizeF &result, const QSizeF &size)
GLfloat GLfloat GLfloat w
[0]
GLint GLsizei GLsizei height
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLdouble GLdouble GLdouble GLdouble top
GLdouble GLdouble GLdouble GLdouble q
static qreal component(const QPointF &point, unsigned int i)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent