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>
51 ~QtPrivate::QBindableInterface::MetaTypeAccessorFlag)
56 This->m_bindingData.registerWithCurrentlyEvaluatingBinding();
63 This->m_bindingData.notifyObservers(
reinterpret_cast<QUntypedPropertyData *
>(This->m_storage.data()));
83 return This->m_bindingData.setBinding(binding,
85 This->m_storage.data()));
98 This->m_sourceInterface->
setObserver(This->m_sourcePropertyData, observer);
197 delete d->animationInstance;
217 qmlWarning(
this) <<
tr(
"Cannot change the animation assigned to a Behavior.");
223 d->animation->setDefaultTarget(
d->property);
224 d->animation->setDisableUserControl();
232 This->q_func()->write(This->propertyProxy->value());
276 return d->targetValue;
362 const bool targetValueHasChanged =
d->targetValue !=
value;
363 if (targetValueHasChanged) {
371 if (
d->animationInstance)
372 d->animationInstance->stop();
377 bool behaviorActive =
d->animation->isRunning();
378 if (behaviorActive && !targetValueHasChanged)
381 if (
d->animationInstance
382 && (
d->animationInstance->duration() != -1
383 ||
d->animationInstance->isRenderThreadProxy())
384 && !
d->animationInstance->isStopped()) {
385 d->blockRunningChanged =
true;
386 d->animationInstance->stop();
409 Q_ASSERT(newInstance !=
d->animationInstance);
410 delete d->animationInstance;
411 d->animationInstance = newInstance;
413 if (
d->animationInstance) {
418 d->animationInstance->start();
419 d->blockRunningChanged =
false;
429 if (!
d->propertyProxy)
430 d->propertyProxy = std::make_unique<UntypedProxyProperty>(
target,
d);
431 *untypedBindable =
d->propertyProxy->getBindable();
440 d->animation->setDefaultTarget(
property);
444 d->propertyProxy = std::make_unique<UntypedProxyProperty>(untypedBindable,
d);
456#include "moc_qquickbehavior_p.cpp"
static QPropertyBindingPrivate * get(const QUntypedPropertyBinding &binding)
void setSource(const Property &property)
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.
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.
FINALQQmlProperty targetProperty
void write(const QVariant &value) override
This method will be called when a new value is assigned to the property being intercepted.
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
bool hasBinding() const
Returns true if the underlying property has a binding.
QUntypedPropertyBinding takeBinding()
Removes the currently set binding from the property and returns it.
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
bool contains(const AT &t) const noexcept
static constexpr quintptr MetaTypeAccessorFlag
UntypedProxyPropertyBindable(UntypedProxyProperty *property)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent