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
4#ifndef QPROPERTYANIMATION_P_H
5#define QPROPERTYANIMATION_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 "qpropertyanimation.h"
19
20#include "private/qvariantanimation_p.h"
21#include "private/qproperty_p.h"
22
23QT_REQUIRE_CONFIG(animation);
24
25QT_BEGIN_NAMESPACE
26
27class QPropertyAnimationPrivate : public QVariantAnimationPrivate
28{
29 Q_DECLARE_PUBLIC(QPropertyAnimation)
30public:
31 QPropertyAnimationPrivate() : propertyType(0), propertyIndex(-1) { }
32
33 void setTargetObjectForwarder(QObject *target) { q_func()->setTargetObject(target); }
34 Q_OBJECT_COMPAT_PROPERTY_WITH_ARGS(QPropertyAnimationPrivate, QObject *, targetObject,
35 &QPropertyAnimationPrivate::setTargetObjectForwarder,
36 nullptr)
37 void targetObjectDestroyed()
38 {
39 // stop() has to be called before targetObject is set to nullptr.
40 // targetObject must not be nullptr in states unequal to "Stopped".
41 q_func()->stop();
42 targetObject.setValueBypassingBindings(nullptr);
43 targetObject.notify();
44 }
45
46 //for the QProperty
47 int propertyType;
48 int propertyIndex;
49
50 void setPropertyName(const QByteArray &propertyName)
51 {
52 q_func()->setPropertyName(propertyName);
53 }
54 Q_OBJECT_COMPAT_PROPERTY(QPropertyAnimationPrivate, QByteArray, propertyName,
55 &QPropertyAnimationPrivate::setPropertyName)
56 void updateProperty(const QVariant &);
57 void updateMetaProperty();
58};
59
60QT_END_NAMESPACE
61
62#endif //QPROPERTYANIMATION_P_H
63

source code of qtbase/src/corelib/animation/qpropertyanimation_p.h