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
qpropertyanimation.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 QPROPERTYANIMATION_H
6#define QPROPERTYANIMATION_H
7
8#include <QtCore/qvariantanimation.h>
9
11
12QT_BEGIN_NAMESPACE
13
14class QPropertyAnimationPrivate;
15class Q_CORE_EXPORT QPropertyAnimation : public QVariantAnimation
16{
17 Q_OBJECT
18 Q_PROPERTY(QByteArray propertyName READ propertyName WRITE setPropertyName
19 BINDABLE bindablePropertyName)
20 Q_PROPERTY(QObject* targetObject READ targetObject WRITE setTargetObject
21 BINDABLE bindableTargetObject)
22
23public:
24 QPropertyAnimation(QObject *parent = nullptr);
25 QPropertyAnimation(QObject *target, const QByteArray &propertyName, QObject *parent = nullptr);
26 ~QPropertyAnimation();
27
28 QObject *targetObject() const;
29 void setTargetObject(QObject *target);
30 QBindable<QObject *> bindableTargetObject();
31
32 QByteArray propertyName() const;
33 void setPropertyName(const QByteArray &propertyName);
34 QBindable<QByteArray> bindablePropertyName();
35
36protected:
37 bool event(QEvent *event) override;
38 void updateCurrentValue(const QVariant &value) override;
39 void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState) override;
40
41private:
42 Q_DISABLE_COPY(QPropertyAnimation)
43 Q_DECLARE_PRIVATE(QPropertyAnimation)
44};
45
46QT_END_NAMESPACE
47
48#endif // QPROPERTYANIMATION_H
QT_REQUIRE_CONFIG(animation)