Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquickspritesequence_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// Qt-Security score:significant reason:default
4
5#ifndef QQUICKSPRITESEQUENCE_P_H
6#define QQUICKSPRITESEQUENCE_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <private/qtquickglobal_p.h>
20
22
23#include <QtQuick/QQuickItem>
24
25QT_BEGIN_NAMESPACE
26
27class QSGContext;
28class QQuickSprite;
29class QQuickSpriteEngine;
31class QSGSpriteNode;
32class Q_QUICK_EXPORT QQuickSpriteSequence : public QQuickItem
33{
34 Q_OBJECT
35 Q_PROPERTY(bool running READ running WRITE setRunning NOTIFY runningChanged)
36 Q_PROPERTY(bool interpolate READ interpolate WRITE setInterpolate NOTIFY interpolateChanged)
37 Q_PROPERTY(QString goalSprite READ goalSprite WRITE setGoalSprite NOTIFY goalSpriteChanged)
38 Q_PROPERTY(QString currentSprite READ currentSprite NOTIFY currentSpriteChanged)
39 //###try to share similar spriteEngines for less overhead?
40 Q_PROPERTY(QQmlListProperty<QQuickSprite> sprites READ sprites)
41 Q_CLASSINFO("DefaultProperty", "sprites")
42 QML_NAMED_ELEMENT(SpriteSequence)
43 QML_ADDED_IN_VERSION(2, 0)
44
45public:
46 explicit QQuickSpriteSequence(QQuickItem *parent = nullptr);
47
48 QQmlListProperty<QQuickSprite> sprites();
49
50 bool running() const;
51 bool interpolate() const;
52 QString goalSprite() const;
53 QString currentSprite() const;
54
55Q_SIGNALS:
56
57 void runningChanged(bool arg);
58 void interpolateChanged(bool arg);
59 void goalSpriteChanged(const QString &arg);
60 void currentSpriteChanged(const QString &arg);
61
62public Q_SLOTS:
63
64 void jumpTo(const QString &sprite);
65 void setGoalSprite(const QString &sprite);
66 void setRunning(bool arg);
67 void setInterpolate(bool arg);
68
69private Q_SLOTS:
70 void createEngine();
71
72protected:
73 void reset();
74 QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override;
75private:
76 void prepareNextFrame(QSGSpriteNode *node);
77 QSGSpriteNode* initNode();
78
79private:
80 Q_DECLARE_PRIVATE(QQuickSpriteSequence)
81};
82
83QT_END_NAMESPACE
84
85#endif // QQUICKSPRITESEQUENCE_P_H
QT_REQUIRE_CONFIG(quick_sprite)