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
qquickanimatorcontroller_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// Copyright (C) 2016 Gunnar Sletta <gunnar@sletta.org>
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5#ifndef QQUICKANIMATORCONTROLLER_P_H
6#define QQUICKANIMATORCONTROLLER_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 "qquickanimatorjob_p.h"
20#include <QtQuick/qsgnode.h>
21#include <QtQuick/qquickitem.h>
22
23#include <QtCore/qmutex.h>
24#include <QtCore/qthread.h>
25
27
29{
31
32public:
35
36 void advance();
37 void beforeNodeSync();
38 void afterNodeSync();
39
40 void animationFinished(QAbstractAnimationJob *job) override;
42
43 void requestSync();
44
45 // These are called from the GUI thread (the proxy)
46 void start(const QSharedPointer<QAbstractAnimationJob> &job);
47 void cancel(const QSharedPointer<QAbstractAnimationJob> &job);
48 bool isPendingStart(const QSharedPointer<QAbstractAnimationJob> &job) const { return m_rootsPendingStart.contains(job); }
49
50 void lock() { m_mutex.lock(); }
51 void unlock() { m_mutex.unlock(); }
52
53 void windowNodesDestroyed();
54
55 QQuickWindow *window() const { return m_window; }
56
57private:
58 friend class tst_Animators;
59
60 void start_helper(QAbstractAnimationJob *job);
61 void cancel_helper(QAbstractAnimationJob *job);
62
63 QSet<QQuickAnimatorJob * > m_runningAnimators;
64 QHash<QAbstractAnimationJob *, QSharedPointer<QAbstractAnimationJob> > m_animationRoots;
65 QSet<QSharedPointer<QAbstractAnimationJob> > m_rootsPendingStop;
66 QSet<QSharedPointer<QAbstractAnimationJob> > m_rootsPendingStart;
67
68 QQuickWindow *m_window;
69 QMutex m_mutex;
70};
71
72
73
75
76#endif // QQUICKANIMATORCONTROLLER_P_H
virtual void animationStateChanged(QAbstractAnimationJob *, QAbstractAnimationJob::State, QAbstractAnimationJob::State)
virtual void animationFinished(QAbstractAnimationJob *)
\inmodule QtCore
Definition qmutex.h:281
\inmodule QtCore
Definition qobject.h:103
bool isPendingStart(const QSharedPointer< QAbstractAnimationJob > &job) const
\qmltype Window \instantiates QQuickWindow \inqmlmodule QtQuick
void newState(QList< State > &states, const char *token, const char *lexem, bool pre)
Combined button and popup list for selecting options.
GLuint start
#define Q_AUTOTEST_EXPORT
#define Q_OBJECT
future cancel()
aWidget window() -> setWindowTitle("New Window Title")
[2]