File indexing completed on 2026-03-30 08:27:30
0001
0002
0003
0004
0005 #ifndef QPROPERTYANIMATION_H
0006 #define QPROPERTYANIMATION_H
0007
0008 #include <QtCore/qvariantanimation.h>
0009
0010 QT_REQUIRE_CONFIG(animation);
0011
0012 QT_BEGIN_NAMESPACE
0013
0014 class QPropertyAnimationPrivate;
0015 class Q_CORE_EXPORT QPropertyAnimation : public QVariantAnimation
0016 {
0017 Q_OBJECT
0018 Q_PROPERTY(QByteArray propertyName READ propertyName WRITE setPropertyName
0019 BINDABLE bindablePropertyName)
0020 Q_PROPERTY(QObject* targetObject READ targetObject WRITE setTargetObject
0021 BINDABLE bindableTargetObject)
0022
0023 public:
0024 QPropertyAnimation(QObject *parent = nullptr);
0025 QPropertyAnimation(QObject *target, const QByteArray &propertyName, QObject *parent = nullptr);
0026 ~QPropertyAnimation();
0027
0028 QObject *targetObject() const;
0029 void setTargetObject(QObject *target);
0030 QBindable<QObject *> bindableTargetObject();
0031
0032 QByteArray propertyName() const;
0033 void setPropertyName(const QByteArray &propertyName);
0034 QBindable<QByteArray> bindablePropertyName();
0035
0036 protected:
0037 bool event(QEvent *event) override;
0038 void updateCurrentValue(const QVariant &value) override;
0039 void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState) override;
0040
0041 private:
0042 Q_DISABLE_COPY(QPropertyAnimation)
0043 Q_DECLARE_PRIVATE(QPropertyAnimation)
0044 };
0045
0046 QT_END_NAMESPACE
0047
0048 #endif