23 for (
int i = 0;
i <
n; ++
i) {
31 l->d_func()->reparentChildItems(newParent);
35 if (childParent && childParent != newParent && itemChild->
isWidget() && qt_graphicsLayoutDebug()) {
37 qWarning(
"QGraphicsLayout::addChildLayout: widget %s \"%s\" in wrong parent; moved to correct parent",
38 w->metaObject()->className(),
w->objectName().toLocal8Bit().constData());
41 if (childParent != newParent)
42 itemChild->setParentItem(newParent);
54 if (userMargin >= 0.0) {
63 if (layoutParentItem->isWidget())
72 if (maybeWidget->isWidget())
83 for (
int i = lay->
count() - 1;
i >= 0; --
i) {
111 if (maybeLayout->isLayout())
123 if (oldParent == newParent || !newParent)
129 qWarning(
"QGraphicsLayout::addChildLayoutItem: %s \"%s\" in wrong parent; moved to correct parent",
130 w->metaObject()->className(),
w->objectName().toLocal8Bit().constData());
141 if (
item->isLayout()) {
143 if (
layout->d_func()->activated) {
156 layout->d_func()->activated =
true;
void invalidate() override
Resets cached information.
int count() const override
\reimp
QLayoutItem * itemAt(int) const override
\reimp
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
void setParentItem(QGraphicsItem *parent)
Sets this item's parent item to newParent.
QGraphicsItem * parentItem() const
Returns a pointer to this item's parent item.
QGraphicsLayoutItem * parent
QGraphicsItem * parentItem() const
The QGraphicsLayoutItem class can be inherited to allow your custom items to be managed by layouts.
QGraphicsItem * graphicsItem() const
Returns the QGraphicsItem that this layout item represents.
bool isLayout() const
Returns true if this QGraphicsLayoutItem is a layout (e.g., is inherited by an object that arranges o...
QGraphicsLayoutItem * parentLayoutItem() const
Returns the parent of this QGraphicsLayoutItem, or \nullptr if there is no parent,...
void getMargin(qreal *result, qreal userMargin, QStyle::PixelMetric pm) const
void addChildLayoutItem(QGraphicsLayoutItem *item)
Qt::LayoutDirection visualDirection() const
void activateRecursive(QGraphicsLayoutItem *item)
void reparentChildItems(QGraphicsItem *newParent)
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 ...
static bool instantInvalidatePropagation()
Qt::LayoutDirection layoutDirection
the default layout direction for this application
PixelMetric
This enum describes the various available pixel metrics.
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option=nullptr, const QWidget *widget=nullptr) const =0
Returns the value of the given pixel metric.
Combined button and popup list for selecting options.
static bool removeLayoutItemFromLayout(QGraphicsLayout *lay, QGraphicsLayoutItem *layoutItem)
GLfloat GLfloat GLfloat w
[0]
GLdouble GLdouble GLdouble GLdouble q
static void layoutItem(QQuickItem *item, qreal y, qreal width)