100 d->target->setParentItem(
nullptr);
123 if (attachedData->getControllingProxy() !=
this)
129 if (
t->parentItem() !=
this)
130 pos =
t->parentItem()->mapFromGlobal(mapToGlobal(0, 0));
132 if (
t->size() == sz &&
t->position() ==
pos && newGeom == oldGeom)
159#define propertyForwarding(property, Property) \
160 void QQuickLayoutItemProxy::target##Property##Changed() { \
161 Q_D(QQuickLayoutItemProxy); \
162 QQuickLayoutAttached *attTarget = attachedLayoutObject(target(), false); \
163 QQuickLayoutAttached *attProxy = attachedLayoutObject(this, false); \
164 if (!attTarget) return; \
165 if (attProxy->property() == attTarget->property()) \
167 d->m_expectProxy##Property##Change = true; \
168 attProxy->set##Property(attTarget->property()); \
170 void QQuickLayoutItemProxy::proxy##Property##Changed() { \
171 Q_D(QQuickLayoutItemProxy); \
172 if (d->m_expectProxy##Property##Change) { \
173 d->m_expectProxy##Property##Change = false; \
176 QQuickLayoutAttached *attTarget = attachedLayoutObject(target(), false); \
177 if (!attTarget) return; \
178 disconnect(attTarget, &QQuickLayoutAttached::property##Changed, this, &QQuickLayoutItemProxy::target##Property##Changed); \
198#undef propertyForwarding
229 if (newTarget ==
d->target)
232 d->target = newTarget;
237 if (newTarget->
property(
"QQuickLayoutItemProxyAttachedData").
isValid()) {
242 v.setValue(attachedData);
243 newTarget->
setProperty(
"QQuickLayoutItemProxyAttachedData",
v);
256 disconnect(attTarget,
nullptr, attProxy,
nullptr);
260#define connectPropertyForwarding(property, Property) \
261 if (!attProxy->is##Property##Set()) { \
262 connect(attTarget, &QQuickLayoutAttached::property##Changed, this, &QQuickLayoutItemProxy::target##Property##Changed); \
263 connect(attProxy, &QQuickLayoutAttached::property##Changed, this, &QQuickLayoutItemProxy::proxy##Property##Changed); \
264 target##Property##Changed(); \
282#undef connectPropertyForwarding
299 emit targetChanged();
344 d->target->setVisible(
true);
345 d->target->setParentItem(
this);
350 if (
d->target->parentItem() ==
this) {
351 d->target->setParentItem(
nullptr);
353 qCDebug(lcLayouts) <<
"Parent was changed to" <<
d->target->parentItem() <<
"while an ItemProxy had control";
354 d->target->setVisible(
false);
369 if (attachedData->getControllingProxy() ==
this)
377 m_expectProxyMinimumWidthChange(
false),
378 m_expectProxyMinimumHeightChange(
false),
379 m_expectProxyPreferredWidthChange(
false),
380 m_expectProxyPreferredHeightChange(
false),
381 m_expectProxyMaximumWidthChange(
false),
382 m_expectProxyMaximumHeightChange(
false),
383 m_expectProxyFillWidthChange(
false),
384 m_expectProxyFillHeightChange(
false),
385 m_expectProxyAlignmentChange(
false),
386 m_expectProxyHorizontalStretchFactorChange(
false),
387 m_expectProxyVerticalStretchFactorChange(
false),
388 m_expectProxyMarginsChange(
false),
389 m_expectProxyLeftMarginChange(
false),
390 m_expectProxyTopMarginChange(
false),
391 m_expectProxyRightMarginChange(
false),
392 m_expectProxyBottomMarginChange(
false)
417 proxy->clearTarget();
468 <<
"takes control of"
489 <<
"no longer controls"
496 for (
auto &otherProxy: std::as_const(
proxies)) {
497 if (
proxy != otherProxy)
498 otherProxy->maybeTakeControl();
QObject * parent() const
Returns a pointer to the parent object.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
QVariant property(const char *name) const
Returns the value of the object's name property.
bool setProperty(const char *name, const QVariant &value)
Sets the value of the object's name property to value.
void deleteLater()
\threadsafe
\inmodule QtCore\reentrant
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
virtual void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry)
void implicitWidthChanged()
void implicitHeightChanged()
virtual QRectF boundingRect() const
Returns the extents of the item in its own coordinate system: a rectangle from {0,...
virtual void itemChange(ItemChange, const ItemChangeData &)
Called when change occurs for this item.
void setImplicitHeight(qreal)
ItemChange
Used in conjunction with QQuickItem::itemChange() to notify the item about certain types of changes.
void setImplicitWidth(qreal)
Provides attached properties for items that are managed by one or more LayoutItemProxy.
QML_ANONYMOUSbool proxyHasControl
void controllingProxyChanged()
QQuickLayoutItemProxyAttachedData(QObject *parent)
void registerProxy(QQuickLayoutItemProxy *proxy)
QQuickLayoutItemProxyAttachedData::registerProxy registers a proxy that manages the item this data is...
void releaseControl(QQuickLayoutItemProxy *proxy)
QQuickLayoutItemProxyAttachedData::releaseControl is called by LayoutItemProxies when they try no lon...
~QQuickLayoutItemProxyAttachedData() override
QQuickLayoutItemProxy * controllingProxy
QList< QQuickLayoutItemProxy * > proxies
bool takeControl(QQuickLayoutItemProxy *proxy)
QQuickLayoutItemProxyAttachedData::takeControl is called by LayoutItemProxies when they try to take c...
void releaseProxy(QQuickLayoutItemProxy *proxy)
QQuickLayoutItemProxyAttachedData::releaseProxy removes a proxy from a list of known proxies that man...
const QList< QQuickLayoutItemProxy * > & getProxies() const
QQuickLayoutItemProxyAttachedData::getProxies.
QQuickLayoutItemProxy * getControllingProxy() const
QQuickLayoutItemProxyAttachedData::getControllingProxy.
QQuickLayoutItemProxyPrivate()
void clearTarget()
QQuickLayoutItemProxy::clearTarget sets the target to null.
void setTarget(QQuickItem *newTarget)
QQuickLayoutItemProxy::setTarget sets the target.
void geometryChange(const QRectF &newGeom, const QRectF &oldGeom) override
QQuickLayoutItemProxy::geometryChange Reimplementation of QQuickItem::geometryChange to update the ta...
void itemChange(ItemChange c, const ItemChangeData &d) override
QQuickLayoutItemProxy::itemChange is a reimplementation of QQuickItem::itemChange to react to changes...
void maybeTakeControl()
QQuickLayoutItemProxy::maybeTakeControl checks and takes over control of the item.
void updatePos()
QQuickLayoutItemProxy::updatePos sets the geometry of the target to the geometry of the proxy.
~QQuickLayoutItemProxy() override
Q_INVOKABLE QQuickItem * effectiveTarget() const
QQuickLayoutItemProxy::effectiveTarget.
\inmodule QtCore\reentrant
constexpr QSizeF size() const noexcept
Returns the size of the rectangle.
bool isValid() const
Returns true if the storage type of this variant is not QMetaType::UnknownType; otherwise returns fal...
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define Q_LOGGING_CATEGORY(name,...)
#define qCDebug(category,...)
GLsizei const GLfloat * v
[13]
QQuickLayoutAttached * attachedLayoutObject(QQuickItem *item, bool create=true)
#define connectPropertyForwarding(property, Property)
#define propertyForwarding(property, Property)
myObject disconnect()
[26]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent