7#include <QtQuick/qsgnode.h>
9#include <QQmlComponent>
98 clock =
new Clock(
this);
136 m_deletables <<
item;
137 data->delegate =
nullptr;
155void QQuickItemParticle::processDeletables()
162 if ((mpa = qobject_cast<QQuickItemParticleAttached*>(qmlAttachedPropertiesObject<QQuickItemParticle>(
item)))) {
163 if (mpa->m_parentItem !=
nullptr)
174 m_deletables.
clear();
177void QQuickItemParticle::tick(
int time)
183 if (!
d->delegate &&
d->t != -1 &&
d->stillAlive(
m_system)) {
185 if (!m_pendingItems.
isEmpty()){
190 }
else if (m_delegate){
193 m_managed <<
d->delegate;
195 if (d &&
d->delegate){
196 d->delegate->setX(
d->curX(
m_system) -
d->delegate->width() / 2);
197 d->delegate->setY(
d->curY(
m_system) -
d->delegate->height() / 2);
198 QQuickItemParticleAttached* mpa = qobject_cast<QQuickItemParticleAttached*>(qmlAttachedPropertiesObject<QQuickItemParticle>(
d->delegate));
204 d->delegate->setParentItem(
this);
206 d->delegate->setOpacity(0.);
207 d->delegate->setVisible(
false);
221 QSet<QQuickItem*> lost = QSet<QQuickItem*>(m_managed.
cbegin(), m_managed.
cend());
224 lost.remove(
d->delegate);
227 m_deletables.
unite(lost);
239 if (clockShouldUpdate()) {
253 qreal curT = timeStamp/1000.0;
254 qreal dt = curT - m_lastT;
265 float t = ((timeStamp / 1000.0f) -
data->t) /
data->lifeSpan;
271 m_deletables <<
item;
272 data->delegate =
nullptr;
295bool QQuickItemParticle::clockShouldUpdate()
const
302void QQuickItemParticle::reconnectParent(
QQuickItem *parentItem)
308 this, &QQuickItemParticle::updateClock);
320 QQuickItemParticle::updateClock();
323 QQuickItemParticle::updateClock();
326 &QQuickItemParticle::updateClock);
330void QQuickItemParticle::updateClock()
332 if (clockShouldUpdate()) {
333 if (!clock->isRunning())
336 if (clock->isRunning())
343#include "moc_qquickitemparticle_p.cpp"
DarwinBluetooth::DeviceInquiryDelegate * m_delegate
void setOpacity(qreal opacity)
void setParentItem(QGraphicsItem *parent)
Sets this item's parent item to newParent.
QGraphicsItem * parentItem() const
Returns a pointer to this item's parent item.
void setVisible(bool visible)
If visible is true, the item is made visible.
void push_front(rvalue_ref t)
bool isEmpty() const noexcept
void push_back(parameter_type t)
void pop_front() noexcept
const_iterator cend() const noexcept
const_iterator cbegin() const noexcept
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
virtual QObject * create(QQmlContext *context=nullptr)
Create an object instance from this component, within the specified context.
static QQuickItemParticleAttached * qmlAttachedProperties(QObject *object)
void commit(int gIdx, int pIdx) override
void give(QQuickItem *item)
void initialize(int gIdx, int pIdx) override
QQuickItemParticle(QQuickItem *parent=nullptr)
\qmltype ItemParticle \instantiates QQuickItemParticle \inqmlmodule QtQuick.Particles \inherits Parti...
QSGNode * updatePaintNode(QSGNode *, UpdatePaintNodeData *) override
Called on the render thread when it is time to sync the state of the item with the scene graph.
void freeze(QQuickItem *item)
void take(QQuickItem *item, bool prioritize=false)
void unfreeze(QQuickItem *item)
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
void parentChanged(QQuickItem *)
virtual QSGNode * updatePaintNode(QSGNode *, UpdatePaintNodeData *)
Called on the render thread when it is time to sync the state of the item with the scene graph.
void setFlag(Flag flag, bool enabled=true)
Enables the specified flag for this item if enabled is true; if enabled is false, the flag is disable...
QQuickItem * parentItem() const
QQuickItem * parent
\qmlproperty Item QtQuick::Item::parent This property holds the visual parent of the item.
void update()
Schedules a call to updatePaintNode() for this item.
void systemChanged(QQuickParticleSystem *arg)
const GroupIDs & groupIds() const
QQuickParticleSystem * m_system
QQuickParticleSystem * system
void runningChanged(bool arg)
QVarLengthArray< QQuickParticleGroupData *, 32 > groupData
void pausedChanged(bool arg)
int systemSync(QQuickParticlePainter *p)
\group qtquick-scenegraph-nodes \title Qt Quick Scene Graph Node classes
bool remove(const T &value)
QSet< T > & unite(const QSet< T > &other)
bool contains(const T &value) const
qDeleteAll(list.begin(), list.end())
Combined button and popup list for selecting options.
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
QQmlContext * qmlContext(const QObject *obj)
QQuickItem * qobject_cast< QQuickItem * >(QObject *o)
myObject disconnect()
[26]
qsizetype indexOf(const AT &t, qsizetype from=0) const noexcept