Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qquickparticlegroup.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
5
58 , m_system(nullptr)
59{
60
61}
62
64{
65 QQuickParticleGroup* pg = qobject_cast<QQuickParticleGroup*>(prop->object);
66 if (pg)
68}
69
71{
72 QQuickParticleSystem* system = qobject_cast<QQuickParticleSystem*>(parent());
73 if (system) {
74 return QQmlListProperty<QObject>(this, nullptr,
76 nullptr, nullptr, nullptr, nullptr);
77 } else {
78 return QQmlListProperty<QObject>(this, nullptr,
79 &delayedRedirect, nullptr, nullptr,
80 nullptr, nullptr, nullptr);
81 }
82}
83
85{
86 if (m_system != arg) {
87 m_system = arg;
88 m_system->registerParticleGroup(this);
89 performDelayedRedirects();
91 }
92}
93
95{
96 m_delayedRedirects << obj;
97}
98
99void QQuickParticleGroup::performDelayedRedirects()
100{
101 if (!m_system)
102 return;
103 foreach (QObject* obj, m_delayedRedirects)
104 m_system->stateRedirect(this, m_system, obj);
105
106 m_delayedRedirects.clear();
107}
108
110 if (!m_system && qobject_cast<QQuickParticleSystem*>(parent()))
111 setSystem(qobject_cast<QQuickParticleSystem*>(parent()));
112}
113
114#include "moc_qquickparticlegroup_p.cpp"
void clear()
Definition qlist.h:417
\inmodule QtCore
Definition qobject.h:90
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:311
The QQmlListProperty class allows applications to expose list-like properties of QObject-derived clas...
Definition qqmllist.h:24
QObject * object
Definition qqmllist.h:81
void setSystem(QQuickParticleSystem *arg)
void systemChanged(QQuickParticleSystem *arg)
QQmlListProperty< QObject > particleChildren
void delayRedirect(QObject *obj)
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
QQuickParticleGroup(QObject *parent=nullptr)
\qmltype ParticleGroup \instantiates QQuickParticleGroup \inqmlmodule QtQuick.Particles
QQuickParticleSystem * system
void registerParticleGroup(QQuickParticleGroup *g)
static void stateRedirect(QQuickParticleGroup *group, QQuickParticleSystem *sys, QObject *value)
static void statePropertyRedirect(QQmlListProperty< QObject > *prop, QObject *value)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLhandleARB obj
[2]
void delayedRedirect(QQmlListProperty< QObject > *prop, QObject *value)
SSL_CTX int(*) void arg)
#define emit
QObject::connect nullptr
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent