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
qquick3dparticlespritesequence_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QQUICK3DPARTICLESPRITESEQUENCE_H
5#define QQUICK3DPARTICLESPRITESEQUENCE_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//
17
18#include <QObject>
19#include <QQmlEngine>
20#include <QtQml/qqmlparserstatus.h>
21#include <QtQuick3DParticles/qtquick3dparticlesglobal.h>
22#include <private/qglobal_p.h>
23
25
27
28class Q_QUICK3DPARTICLES_EXPORT QQuick3DParticleSpriteSequence : public QObject, public QQmlParserStatus
29{
31 Q_PROPERTY(int frameCount READ frameCount WRITE setFrameCount NOTIFY frameCountChanged)
32 Q_PROPERTY(int frameIndex READ frameIndex WRITE setFrameIndex NOTIFY frameIndexChanged)
33 Q_PROPERTY(bool interpolate READ interpolate WRITE setInterpolate NOTIFY interpolateChanged)
34 Q_PROPERTY(int duration READ duration WRITE setDuration NOTIFY durationChanged)
35 Q_PROPERTY(int durationVariation READ durationVariation WRITE setDurationVariation NOTIFY durationVariationChanged)
36 Q_PROPERTY(bool randomStart READ randomStart WRITE setRandomStart NOTIFY randomStartChanged)
37 Q_PROPERTY(AnimationDirection animationDirection READ animationDirection WRITE setAnimationDirection NOTIFY animationDirectionChanged)
38
39 QML_NAMED_ELEMENT(SpriteSequence3D)
42
43public:
52 Q_ENUM(AnimationDirection)
53
54 QQuick3DParticleSpriteSequence(QObject *parent = nullptr);
56
57 int frameCount() const;
58 int frameIndex() const;
59 bool interpolate() const;
60 int duration() const;
61 int durationVariation() const;
62 bool randomStart() const;
63 AnimationDirection animationDirection() const;
64
65public Q_SLOTS:
66 void setFrameCount(int frameCount);
67 void setFrameIndex(int frameIndex);
68 void setInterpolate(bool interpolate);
69 void setDuration(int duration);
70 void setDurationVariation(int durationVariation);
71 void setRandomStart(bool randomStart);
72 void setAnimationDirection(QQuick3DParticleSpriteSequence::AnimationDirection animationDirection);
73
82
83protected:
84 // From QQmlParserStatus
85 void componentComplete() override;
86 void classBegin() override {}
87
88private:
91
92 void markNodesDirty();
93 float firstFrame(int index, bool singleFrame);
94
95 QQuick3DParticleSpriteParticle *m_parentParticle = nullptr;
96 int m_frameCount = 1;
97 int m_frameIndex = 0;
98 bool m_interpolate = true;
99 int m_duration = -1;
100 int m_durationVariation = 0;
101 bool m_randomStart = false;
102 AnimationDirection m_animationDirection = AnimationDirection::Normal;
103};
104
106
107#endif // QQUICK3DPARTICLESPRITESEQUENCE_H
\inmodule QtCore
Definition qobject.h:103
The QQmlParserStatus class provides updates on the QML parser state.
void classBegin() override
Invoked after class creation, but before any properties have been set.
Combined button and popup list for selecting options.
static qreal interpolate(const QPair< QGraphicsAnchorLayoutPrivate::Interval, qreal > &factor, qreal min, qreal minPref, qreal pref, qreal maxPref, qreal max)
GLuint index
[2]
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define Q_ENUM(x)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_INTERFACES(x)
#define Q_SLOTS
#define Q_SIGNALS
animation setDuration(1000)