Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquickparticlesystem.cpp File Reference

(9c54252914634a6756b39261b027b48b96c6ea7b)

#include "qquickparticlesystem_p.h"
#include <QtQuick/qsgnode.h>
#include "qquickparticleemitter_p.h"
#include "qquickparticleaffector_p.h"
#include "qquickparticlepainter_p.h"
#include <private/qquickspriteengine_p.h>
#include <private/qquicksprite_p.h>
#include "qquickv4particledata_p.h"
#include "qquickparticlegroup_p.h"
#include "qquicktrailemitter_p.h"
#include <private/qqmlengine_p.h>
#include <private/qqmlglobal_p.h>
#include <private/qqmlvaluetypewrapper_p.h>
#include <cmath>
#include <QDebug>
#include "moc_qquickparticlesystem_p.cpp"
+ Include dependency graph for qquickparticlesystem.cpp:

Go to the source code of this file.

Functions

static QT_BEGIN_NAMESPACE int roundedTime (qreal a)
 A system which includes particle painter, emitter, and affector types.
 

Function Documentation

◆ roundedTime()

static QT_BEGIN_NAMESPACE int roundedTime ( qreal a)
inlinestatic

A system which includes particle painter, emitter, and affector types.

\qmltype ParticleSystem

! \instantiates QQuickParticleSystem \inqmlmodule QtQuick.Particles

\qmlproperty bool QtQuick.Particles::ParticleSystem::running

If running is set to false, the particle system will stop the simulation. All particles will be destroyed when the system is set to running again.

It can also be controlled with the start() and stop() methods.

\qmlproperty bool QtQuick.Particles::ParticleSystem::paused

If paused is set to true, the particle system will not advance the simulation. When paused is set to false again, the simulation will resume from the same point it was paused.

The simulation will automatically pause if it detects that there are no live particles left, and unpause when new live particles are added.

It can also be controlled with the pause() and resume() methods.

\qmlproperty bool QtQuick.Particles::ParticleSystem::empty

empty is set to true when there are no live particles left in the system.

You can use this to pause the system, keeping it from spending any time updating, but you will need to resume it in order for additional particles to be generated by the system.

To kill all the particles in the system, use an Age affector.

\qmlproperty list<Sprite> QtQuick.Particles::ParticleSystem::particleStates

You can define a sub-set of particle groups in this property in order to provide them with stochastic state transitions.

Each QtQuick::Sprite in this list is interpreted as corresponding to the particle group with the same name. Any transitions defined in these sprites will take effect on the particle groups as well. Additionally TrailEmitters, Affectors and ParticlePainters defined inside one of these sprites are automatically associated with the corresponding particle group.

\qmlmethod QtQuick.Particles::ParticleSystem::pause()

Pauses the simulation if it is running.

See also
resume, paused

\qmlmethod QtQuick.Particles::ParticleSystem::resume()

Resumes the simulation if it is paused.

See also
pause, paused

\qmlmethod QtQuick.Particles::ParticleSystem::start()

Starts the simulation if it has not already running.

See also
stop, restart, running

\qmlmethod QtQuick.Particles::ParticleSystem::stop()

Stops the simulation if it is running.

See also
start, restart, running

\qmlmethod QtQuick.Particles::ParticleSystem::restart()

Stops the simulation if it is running, and then starts it.

See also
start, stop, running

\qmlmethod QtQuick.Particles::ParticleSystem::reset()

Discards all currently existing particles.

Definition at line 168 of file qquickparticlesystem.cpp.

References qRound().

Referenced by QQuickParticleDataHeap::insert(), and QQuickParticleGroupData::prepareRecycler().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: