110 d->layoutPrivate = parentLayout->d_func();
144 return d->sizePolicy;
182 d->createLayoutEdges();
192 for (
int i =
count() - 1;
i >= 0; --
i) {
196 if (
item->ownedByLayout())
203 d->deleteLayoutEdges();
252 return d->getAnchor(firstItem, firstEdge, secondItem, secondEdge);
287 if (
d->addAnchor(firstItem, firstEdge, secondItem, secondEdge)) {
291 d->addAnchor(firstItem, firstEdge, secondItem, secondEdge);
315 Qt::Orientations orientations)
407 d->setItemsGeometries(geom);
429 d->removeAnchors(
item);
432 item->setParentLayoutItem(
nullptr);
442 return d->items.size();
451 return d->items.value(
index);
461 d->calculateGraphCacheDirty =
true;
462 d->styleInfoDirty =
true;
496#include "moc_qgraphicsanchorlayout.cpp"
The QGraphicsAnchorLayout class provides a layout where one can anchor widgets together in Graphics V...
void setGeometry(const QRectF &rect) override
\reimp
QGraphicsAnchor * addAnchor(QGraphicsLayoutItem *firstItem, Qt::AnchorPoint firstEdge, QGraphicsLayoutItem *secondItem, Qt::AnchorPoint secondEdge)
Creates an anchor between the edge firstEdge of item firstItem and the edge secondEdge of item second...
QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint=QSizeF()) const override
\reimp
qreal verticalSpacing() const
Returns the default vertical spacing for the anchor layout.
qreal horizontalSpacing() const
Returns the default horizontal spacing for the anchor layout.
void setSpacing(qreal spacing)
Sets the default horizontal and the default vertical spacing for the anchor layout to spacing.
virtual ~QGraphicsAnchorLayout()
Destroys the QGraphicsAnchorLayout object.
void addCornerAnchors(QGraphicsLayoutItem *firstItem, Qt::Corner firstCorner, QGraphicsLayoutItem *secondItem, Qt::Corner secondCorner)
Creates two anchors between firstItem and secondItem specified by the corners, firstCorner and second...
void setHorizontalSpacing(qreal spacing)
Sets the default horizontal spacing for the anchor layout to spacing.
void addAnchors(QGraphicsLayoutItem *firstItem, QGraphicsLayoutItem *secondItem, Qt::Orientations orientations=Qt::Horizontal|Qt::Vertical)
Anchors two or four edges of firstItem with the corresponding edges of secondItem,...
void setVerticalSpacing(qreal spacing)
Sets the default vertical spacing for the anchor layout to spacing.
QGraphicsLayoutItem * itemAt(int index) const override
\reimp
QGraphicsAnchorLayout(QGraphicsLayoutItem *parent=nullptr)
Constructs a QGraphicsAnchorLayout instance.
QGraphicsAnchor * anchor(QGraphicsLayoutItem *firstItem, Qt::AnchorPoint firstEdge, QGraphicsLayoutItem *secondItem, Qt::AnchorPoint secondEdge)
Returns the anchor between the anchor points defined by firstItem and firstEdge and secondItem and se...
void removeAt(int index) override
Removes the layout item at index without destroying it.
void invalidate() override
\reimp
int count() const override
\reimp
The QGraphicsAnchor class represents an anchor between two items in a QGraphicsAnchorLayout.
~QGraphicsAnchor()
Removes the QGraphicsAnchor object from the layout and destroys it.
void setSizePolicy(QSizePolicy::Policy policy)
QSizePolicy::Policy sizePolicy
the size policy for the QGraphicsAnchor.
qreal spacing
the preferred space between items in the QGraphicsAnchorLayout.
void setSpacing(qreal spacing)
The QGraphicsLayoutItem class can be inherited to allow your custom items to be managed by layouts.
virtual void setGeometry(const QRectF &rect)
This virtual function sets the geometry of the QGraphicsLayoutItem to rect, which is in parent coordi...
The QGraphicsLayout class provides the base class for all layouts in Graphics View.
virtual void invalidate()
Clears any cached geometry and size hint information in the layout, and posts a \l{QEvent::LayoutRequ...
void getContentsMargins(qreal *left, qreal *top, qreal *right, qreal *bottom) const override
\reimp
\inmodule QtCore\reentrant
Policy
This enum describes the various per-dimension sizing types used when constructing a QSizePolicy.
Combined button and popup list for selecting options.
GLboolean GLboolean GLboolean GLboolean a
[7]
GLdouble GLdouble GLdouble GLdouble top
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent