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
qquickbehavior_p.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 QQUICKBEHAVIOR_H
6#define QQUICKBEHAVIOR_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 <private/qtquickglobal_p.h>
20
21#include <private/qqmlpropertyvalueinterceptor_p.h>
22#include <private/qqmlengine_p.h>
23#include <qqml.h>
24#include <private/qqmlfinalizer_p.h>
25
27
28class QQuickAbstractAnimation;
30class Q_QUICK_EXPORT QQuickBehavior : public QObject, public QQmlPropertyValueInterceptor, public QQmlFinalizerHook
31{
32 Q_OBJECT
33 Q_INTERFACES(QQmlFinalizerHook)
34 Q_DECLARE_PRIVATE(QQuickBehavior)
35
36 Q_INTERFACES(QQmlPropertyValueInterceptor)
37 Q_CLASSINFO("DefaultProperty", "animation")
38 Q_PROPERTY(QQuickAbstractAnimation *animation READ animation WRITE setAnimation)
39 Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged)
40 Q_PROPERTY(QVariant targetValue READ targetValue NOTIFY targetValueChanged REVISION(2, 13))
41 Q_PROPERTY(QQmlProperty targetProperty READ targetProperty NOTIFY targetPropertyChanged REVISION(2, 15))
42 Q_CLASSINFO("DeferredPropertyNames", "animation")
43 QML_NAMED_ELEMENT(Behavior)
44 QML_ADDED_IN_VERSION(2, 0)
45
46public:
47 QQuickBehavior(QObject *parent=nullptr);
48 ~QQuickBehavior();
49
50 void setTarget(const QQmlProperty &) override;
51 void write(const QVariant &value) override;
52 bool bindable(QUntypedBindable *untypedBindable, QUntypedBindable target) override;
53
54 QQuickAbstractAnimation *animation();
55 void setAnimation(QQuickAbstractAnimation *);
56
57 bool enabled() const;
58 void setEnabled(bool enabled);
59
60 QVariant targetValue() const;
61
62 QQmlProperty targetProperty() const;
63
64 void componentFinalized() override;
65
66Q_SIGNALS:
67 void enabledChanged();
68 void targetValueChanged();
69 void targetPropertyChanged();
70};
71
72QT_END_NAMESPACE
73
74#endif // QQUICKBEHAVIOR_H
void animationStateChanged(QAbstractAnimationJob *, QAbstractAnimationJob::State newState, QAbstractAnimationJob::State oldState) override
std::unique_ptr< UntypedProxyProperty > propertyProxy
QPointer< QQuickAbstractAnimation > animation
QAbstractAnimationJob * animationInstance
The UntypedProxyProperty class is a property used in Behavior to handle bindable properties.
static QUntypedPropertyBinding bindingSetter(QUntypedPropertyData *d, const QUntypedPropertyBinding &binding)
QUntypedBindable getBindable()
static QUntypedPropertyBinding makeBinding(const QUntypedPropertyData *d, const QPropertyBindingSourceLocation &location)
static void setter(QUntypedPropertyData *d, const void *value)
static void setObserver(const QUntypedPropertyData *d, QPropertyObserver *observer)
static QUntypedPropertyBinding bindingGetter(const QUntypedPropertyData *d)
QVariant value() const
static void getter(const QUntypedPropertyData *d, void *value)
UntypedProxyProperty(QUntypedBindable bindable, QQuickBehaviorPrivate *behavior)
QMetaType type() const
static constexpr QtPrivate::QBindableInterface untypedProxyPropertyBindableInterafce
UntypedProxyPropertyBindable(UntypedProxyProperty *property)