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
qquickage_p.h
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
4#ifndef KILLAFFECTOR_H
5#define KILLAFFECTOR_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
18
20
21class Q_QUICKPARTICLES_EXPORT QQuickAgeAffector : public QQuickParticleAffector
22{
24 Q_PROPERTY(int lifeLeft READ lifeLeft WRITE setLifeLeft NOTIFY lifeLeftChanged)
25 Q_PROPERTY(bool advancePosition READ advancePosition WRITE setAdvancePosition NOTIFY advancePositionChanged)
28
29public:
30 explicit QQuickAgeAffector(QQuickItem *parent = nullptr);
31
32 int lifeLeft() const
33 {
34 return m_lifeLeft;
35 }
36
37 bool advancePosition() const
38 {
39 return m_advancePosition;
40 }
41
42protected:
43 bool affectParticle(QQuickParticleData *d, qreal dt) override;
44
48
49public Q_SLOTS:
50 void setLifeLeft(int arg)
51 {
52 if (m_lifeLeft != arg) {
53 m_lifeLeft = arg;
54 Q_EMIT lifeLeftChanged(arg);
55 }
56 }
57
59 {
60 if (m_advancePosition != arg) {
61 m_advancePosition = arg;
62 Q_EMIT advancePositionChanged(arg);
63 }
64 }
65
66private:
67 int m_lifeLeft;
68 bool m_advancePosition;
69};
70
72#endif // KILLAFFECTOR_H
bool advancePosition() const
Definition qquickage_p.h:37
void advancePositionChanged(bool arg)
void setAdvancePosition(bool arg)
Definition qquickage_p.h:58
void lifeLeftChanged(int arg)
void setLifeLeft(int arg)
Definition qquickage_p.h:50
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
Combined button and popup list for selecting options.
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
SSL_CTX int void * arg
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_EMIT
#define Q_SLOTS
#define Q_SIGNALS
double qreal
Definition qtypes.h:187
#define explicit