1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QBLENDANIMATIONNODE_P_H
5#define QBLENDANIMATIONNODE_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 <QObject>
19#include <QtQml>
20#include <QtQuick/private/qquickanimation_p.h>
21#include <QtQuickTimelineBlendTrees/private/qblendtreenode_p.h>
22
23QT_BEGIN_NAMESPACE
24
25class Q_QUICKTIMELINEBLENDTREES_EXPORT QBlendAnimationNode : public QBlendTreeNode
26{
27 Q_OBJECT
28 Q_PROPERTY(QBlendTreeNode *source1 READ source1 WRITE setSource1 NOTIFY source1Changed FINAL)
29 Q_PROPERTY(QBlendTreeNode *source2 READ source2 WRITE setSource2 NOTIFY source2Changed FINAL)
30 Q_PROPERTY(qreal weight READ weight WRITE setWeight NOTIFY weightChanged FINAL)
31 QML_NAMED_ELEMENT(BlendAnimationNode)
32public:
33 explicit QBlendAnimationNode(QObject *parent = nullptr);
34
35 QBlendTreeNode *source1() const;
36 void setSource1(QBlendTreeNode *newSource1);
37
38 QBlendTreeNode *source2() const;
39 void setSource2(QBlendTreeNode *newSource2);
40
41 qreal weight() const;
42 void setWeight(qreal newWeight);
43
44private Q_SLOTS:
45 void handleInputFrameDataChanged();
46
47Q_SIGNALS:
48 void source1Changed();
49 void source2Changed();
50 void weightChanged();
51
52private:
53 QBlendTreeNode *m_source1 = nullptr;
54 QBlendTreeNode *m_source2 = nullptr;
55 qreal m_weight = 0.5;
56
57 QMetaObject::Connection m_source1OutputConnection;
58 QMetaObject::Connection m_source2OutputConnection;
59 QMetaObject::Connection m_source1DestroyedConnection;
60 QMetaObject::Connection m_source2DestroyedConnection;
61};
62
63QT_END_NAMESPACE
64
65#endif // QBLENDANIMATIONNODE_P_H
66

Provided by KDAB

Privacy Policy
Learn to use CMake with our Intro Training
Find out more

source code of qtquicktimeline/src/timeline/blendtrees/qblendanimationnode_p.h