9#include <private/qqmlproperty_p.h>
10#include <private/qqmlengine_p.h>
11#include <private/qabstractanimationjob_p.h>
12#include <private/qquicktransition_p.h>
14#include <private/qquickanimatorjob_p.h>
16#include <private/qobject_p.h>
17#include <QtCore/qpointer.h>
52 ~QtPrivate::QBindableInterface::MetaTypeAccessorFlag)
57 This->m_bindingData.registerWithCurrentlyEvaluatingBinding();
64 This->m_bindingData.notifyObservers(
reinterpret_cast<QUntypedPropertyData *
>(This->m_storage.data()));
84 return This->m_bindingData.setBinding(binding,
86 This->m_storage.data()));
99 This->m_sourceInterface->
setObserver(This->m_sourcePropertyData, observer);
157 behavior->setSource(m_bindingData);
198 delete d->animationInstance;
218 qmlWarning(
this) <<
tr(
"Cannot change the animation assigned to a Behavior.");
225 d->animation->setDisableUserControl();
233 This->q_func()->write(This->propertyProxy->value());
277 return d->targetValue;
363 const bool targetValueHasChanged =
d->targetValue !=
value;
364 if (targetValueHasChanged) {
372 if (
d->animationInstance)
373 d->animationInstance->stop();
378 bool behaviorActive =
d->animation->isRunning();
379 if (behaviorActive && !targetValueHasChanged)
382 if (
d->animationInstance
383 && (
d->animationInstance->duration() != -1
384 ||
d->animationInstance->isRenderThreadProxy())
385 && !
d->animationInstance->isStopped()) {
386 d->blockRunningChanged =
true;
387 d->animationInstance->stop();
408 QList<QQmlProperty> after;
410 Q_ASSERT(!newInstance || newInstance !=
d->animationInstance);
411 delete d->animationInstance;
412 d->animationInstance = newInstance;
414 if (
d->animationInstance) {
419 d->animationInstance->start();
420 d->blockRunningChanged =
false;
423 if (!after.contains(
d->property))
430 if (!
d->propertyProxy)
431 d->propertyProxy = std::make_unique<UntypedProxyProperty>(
target,
d);
432 *untypedBindable =
d->propertyProxy->getBindable();
441 d->animation->setDefaultTarget(
property);
445 d->propertyProxy = std::make_unique<UntypedProxyProperty>(untypedBindable,
d);
446 if (untypedBindable.hasBinding()) {
457#include "moc_qquickbehavior_p.cpp"
static QPropertyBindingPrivate * get(const QUntypedPropertyBinding &binding)
static bool wasDeleted(const QObject *)
static bool designerMode()
static bool write(QObject *, const QQmlPropertyData &, const QVariant &, const QQmlRefPointer< QQmlContextData > &, QQmlPropertyData::WriteFlags flags={})
The QQmlProperty class abstracts accessing properties on objects created from QML.
QMetaProperty property() const
Returns the \l{QMetaProperty} {Qt property} associated with this QML property.
void setDefaultTarget(const QQmlProperty &)
QAbstractAnimationJob * animationInstance
void animationStateChanged(QAbstractAnimationJob *, QAbstractAnimationJob::State newState, QAbstractAnimationJob::State oldState) override
QPointer< QQuickAbstractAnimation > animation
static void onProxyChanged(QPropertyObserver *, QUntypedPropertyData *)
std::unique_ptr< UntypedProxyProperty > propertyProxy
void setEnabled(bool enabled)
void setTarget(const QQmlProperty &) override
Set the target property for the value interceptor.
void write(const QVariant &value) override
This method will be called when a new value is assigned to the property being intercepted.
QQmlProperty targetProperty
void targetValueChanged()
bool bindable(QUntypedBindable *untypedBindable, QUntypedBindable target) override
void componentFinalized() override
The customization point provided by this interface.
QQuickBehavior(QObject *parent=nullptr)
\qmltype Behavior \instantiates QQuickBehavior \inqmlmodule QtQuick
void targetPropertyChanged()
void setAnimation(QQuickAbstractAnimation *)
QQuickAbstractAnimation * animation
\qmlproperty Animation QtQuick::Behavior::animation \qmldefault
QMetaType valueMetaType() const
Returns the meta-type of the binding.
QMetaType metaType() const
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)
static void getter(const QUntypedPropertyData *d, void *value)
UntypedProxyProperty(QUntypedBindable bindable, QQuickBehaviorPrivate *behavior)
void newState(QList< State > &states, const char *token, const char *lexem, bool pre)
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
static QGtk3Storage * m_storage
GLenum GLenum GLsizei const GLuint GLboolean enabled
void qmlExecuteDeferred(QObject *object)
Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me)
static constexpr QtPrivate::QBindableInterface untypedProxyPropertyBindableInterafce
static constexpr quintptr MetaTypeAccessorFlag
UntypedProxyPropertyBindable(UntypedProxyProperty *property)