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
qquickanimatednode_p.h
Go to the documentation of this file.
1// Copyright (C) 2017 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 QQUICKANIMATEDNODE_P_H
5#define QQUICKANIMATEDNODE_P_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 <QtCore/qobject.h>
19#include <QtQuick/qsgnode.h>
20#include <QtCore/qelapsedtimer.h>
21#include <QtQuickControls2Impl/private/qtquickcontrols2implglobal_p.h>
22
24
25class QQuickItem;
26class QQuickWindow;
27
28class Q_QUICKCONTROLS2IMPL_EXPORT QQuickAnimatedNode : public QObject, public QSGTransformNode
29{
31
32public:
34
35 bool isRunning() const;
36
37 int currentTime() const;
38 void setCurrentTime(int time);
39
40 int duration() const;
41 void setDuration(int duration);
42
43 enum LoopCount { Infinite = -1 };
44
45 int loopCount() const;
46 void setLoopCount(int count);
47
48 virtual void sync(QQuickItem *target);
49
50 QQuickWindow *window() const;
51
52 // must be called from sync() or updatePaintNode()
53 void start(int duration = 0);
54 void restart();
55 void stop();
56
58 void started();
59 void stopped();
60
61protected:
62 virtual void updateCurrentTime(int time);
63
64private Q_SLOTS:
65 void advance();
66 void update();
67
68private:
69 bool m_running = false;
70 int m_duration = 0;
71 int m_loopCount = 1;
72 int m_currentTime = 0;
73 int m_currentLoop = 0;
74 QElapsedTimer m_timer;
75 QQuickWindow *m_window = nullptr;
76};
77
79
80#endif // QQUICKANIMATEDNODE_P_H
\inmodule QtCore
\inmodule QtCore
Definition qobject.h:103
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
\qmltype Window \instantiates QQuickWindow \inqmlmodule QtQuick
The QSGTransformNode class implements transformations in the scene graph.
Definition qsgnode.h:241
Combined button and popup list for selecting options.
GLenum GLenum GLsizei count
GLenum target
GLuint start
static bool isRunning()
Definition main.cpp:452
#define Q_OBJECT
#define Q_SLOTS
#define Q_SIGNALS
static double currentTime()
animation setDuration(1000)
aWidget window() -> setWindowTitle("New Window Title")
[2]