6#include <private/qqmlopenmetaobject_p.h>
7#include <private/qqmlengine_p.h>
10#include <private/qqmlcustomparser_p.h>
12#include <private/qqmlbinding_p.h>
14#include <private/qqmlproperty_p.h>
15#include <private/qqmlcontext_p.h>
16#include <private/qquickstate_p_p.h>
17#include <private/qqmlboundsignal_p.h>
18#include <private/qv4qmlcontext_p.h>
19#include <private/qqmlpropertybinding_p.h>
20#include <private/qqmlirbuilder_p.h>
22#include <QtCore/qdebug.h>
24#include <private/qobject_p.h>
217 switch (binding->
type()) {
220 QQuickPropertyChanges::tr(
221 "PropertyChanges does not support creating state-specific objects."));
255 switch (binding->
type()) {
310 switch (binding->
type()) {
336 for (
int ii = 0; ii <
props.size(); ++ii)
345 p->compilationUnit = compilationUnit;
350 data->releaseDeferredData();
361 for(
int ii = 0; ii <
d->signalReplacements.size(); ++ii)
362 delete d->signalReplacements.at(ii);
374 if (
o !=
d->object) {
398 if (
v !=
d->restore) {
413 qmlWarning(
q) << QQuickPropertyChanges::tr(
"Cannot assign to non-existent property \"%1\"").arg(
property);
416 qmlWarning(
q) << QQuickPropertyChanges::tr(
"Cannot assign to read-only property \"%1\"").arg(
property);
430 for (
int ii = 0; ii <
d->properties.size(); ++ii) {
434 d->properties.at(ii).second);
436 if (
a.property.isValid()) {
442 for (
int ii = 0; ii <
d->signalReplacements.size(); ++ii) {
452 for (
int ii = 0; ii <
d->expressions.size(); ++ii) {
463 a.specifiedObject =
d->object;
475 std::unique_ptr<QQmlBinding> newBinding =
nullptr;
476 if (
e.binding &&
e.binding->isTranslationBinding()) {
483 a.toValue = newBinding->evaluate();
486 if (
e.binding &&
e.binding->isTranslationBinding()) {
490 d->compilationUnit->runtimeFunctions.at(
e.id),
496 a.toBinding = newBinding;
497 a.deletableToBinding =
true;
529 return d->isExplicit;
535 if (
e !=
d->isExplicit) {
546 for (
const PropertyEntry &
entry :
d->properties) {
560 for (
const ExpressionEntry &
entry :
d->expressions) {
579 for (
auto it =
d->expressions.begin(),
end =
d->expressions.end();
it !=
end; ++
it) {
581 d->expressions.erase(
it);
587 d->properties.append(PropertyEntry(
name,
value));
592 for (
auto it =
d->properties.begin(),
end =
d->properties.end();
it !=
end; ++
it) {
609 d->properties.append(PropertyEntry(
name,
value));
624 bool hadValue =
false;
626 for (
auto it =
d->properties.begin(),
end =
d->properties.end();
it !=
end; ++
it) {
628 d->properties.erase(
it);
634 for (
auto it =
d->expressions.begin(),
end =
d->expressions.end();
it !=
end; ++
it) {
638 auto prop =
d->property(
name);
655 auto prop =
d->property(
name);
703 for (
const PropertyEntry &
entry :
d->properties) {
709 for (
const ExpressionEntry &
entry :
d->expressions) {
722 for (
auto it =
d->expressions.begin(),
end =
d->expressions.end();
it !=
end; ++
it) {
724 d->expressions.erase(
it);
730 for (
auto it =
d->properties.begin(),
end =
d->properties.end();
it !=
end; ++
it) {
732 d->properties.erase(
it);
744 for (
const PropertyEntry &
entry :
d->properties) {
758 for (
const ExpressionEntry &
entry :
d->expressions) {
781#include "moc_qquickpropertychanges_p.cpp"
static QObjectPrivate * get(QObject *o)
virtual void setEnabled(bool e, QQmlPropertyData::WriteFlags f=QQmlPropertyData::DontRemoveBinding)=0
QQmlAnyBinding is an abstraction over the various bindings in QML.
static QQmlAnyBinding createFromCodeString(const QQmlProperty &prop, const QString &code, QObject *obj, const QQmlRefPointer< QQmlContextData > &ctxt, const QString &url, quint16 lineNumber)
static void removeBindingFrom(QQmlProperty &prop)
static QQmlAnyBinding createTranslationBinding(const QQmlProperty &prop, const QQmlRefPointer< QV4::ExecutableCompilationUnit > &compilationUnit, const QV4::CompiledData::Binding *translationBinding, QObject *scopeObject=nullptr, QQmlRefPointer< QQmlContextData > context={})
static QQmlAnyBinding takeFrom(const QQmlProperty &prop)
Removes the binding from the property prop, and returns it as a QQmlAnyBinding if there was any.
QQmlAbstractBinding * asAbstractBinding() const
void installOn(const QQmlProperty &target, InterceptorMode mode=IgnoreInterceptors)
static QQmlAnyBinding createFromFunction(const QQmlProperty &prop, QV4::Function *function, QObject *obj, const QQmlRefPointer< QQmlContextData > &ctxt, QV4::ExecutionContext *scope)
static QQmlBinding * createTranslationBinding(const QQmlRefPointer< QV4::ExecutableCompilationUnit > &unit, const QV4::CompiledData::Binding *binding, QObject *obj, const QQmlRefPointer< QQmlContextData > &ctxt)
static QQmlBinding * create(const QQmlPropertyData *, const QQmlScriptString &, QObject *, QQmlContext *)
static QQmlRefPointer< QQmlContextData > get(QQmlContext *context)
static QQmlData * get(QObjectPrivate *priv, bool create)
QQmlContextData * outerContext
static QQmlBoundSignalExpression * signalExpression(const QQmlProperty &that)
Returns the expression associated with this signal property, or 0 if no signal expression exists.
static QQmlProperty create(QObject *target, const QString &propertyName, const QQmlRefPointer< QQmlContextData > &context, QQmlPropertyPrivate::InitFlags flags)
static void removeBinding(const QQmlProperty &that)
static void setSignalExpression(const QQmlProperty &that, QQmlBoundSignalExpression *)
Set the signal expression associated with this signal property to expr.
static QQmlPropertyPrivate * get(const QQmlProperty &p)
static QQmlAbstractBinding * binding(QObject *, QQmlPropertyIndex index)
The QQmlProperty class abstracts accessing properties on objects created from QML.
bool isValid() const
Returns true if the QQmlProperty refers to a valid property, otherwise false.
QVariant read() const
Returns the property value.
Type type() const
Returns the type of the property.
QMetaProperty property() const
Returns the \l{QMetaProperty} {Qt property} associated with this QML property.
QML_ANONYMOUSQObject * object
bool isSignalProperty() const
Returns true if this QQmlProperty represents a QML signal property.
bool isWritable() const
Returns true if the property is writable, otherwise false.
QQmlRefPointer< T > & adopt(T *)
Takes ownership of other.
void verifyBindings(const QQmlRefPointer< QV4::ExecutableCompilationUnit > &compilationUnit, const QList< const QV4::CompiledData::Binding * > &props) override
void verifyList(const QQmlRefPointer< QV4::ExecutableCompilationUnit > &compilationUnit, const QV4::CompiledData::Binding *binding)
void applyBindings(QObject *obj, const QQmlRefPointer< QV4::ExecutableCompilationUnit > &compilationUnit, const QList< const QV4::CompiledData::Binding * > &bindings) override
ExpressionChange(const QString &_name, const QV4::CompiledData::Binding *_binding, QQmlBinding::Identifier _id, const QString &_expr, const QUrl &_url, int _line, int _column)
QQmlBinding::Identifier id
const QV4::CompiledData::Binding * binding
QQmlProperty property(const QString &)
QPointer< QObject > object
QList< QQuickReplaceSignalHandler * > signalReplacements
void decodeBinding(const QString &propertyPrefix, const QQmlRefPointer< QV4::ExecutableCompilationUnit > &qmlUnit, const QV4::CompiledData::Binding *binding)
QList< QPair< QString, QVariant > > properties
QQuickPropertyChangesPrivate()
QList< const QV4::CompiledData::Binding * > bindings
QQmlRefPointer< QV4::ExecutableCompilationUnit > compilationUnit
QList< ExpressionChange > expressions
void changeExpression(const QString &name, const QString &expression)
void removeProperty(const QString &name)
bool containsProperty(const QString &name) const
QString expression(const QString &name) const
QVariant property(const QString &name) const
void setObject(QObject *)
bool isExplicit() const
\qmlproperty bool QtQuick::PropertyChanges::explicit
bool containsExpression(const QString &name) const
bool containsValue(const QString &name) const
QVariant value(const QString &name) const
void setRestoreEntryValues(bool)
ActionList actions() override
void changeValue(const QString &name, const QVariant &value)
void restoreEntryValuesChanged()
\qmltype PropertyChanges \inqmlmodule QtQuick
QQuickReplaceSignalHandler()
void copyOriginals(QQuickStateActionEvent *other) override
bool needsCopy() override
~QQuickReplaceSignalHandler()
QQmlRefPointer< QQmlBoundSignalExpression > expression
bool mayOverride(QQuickStateActionEvent *other) override
EventType type() const override
void saveCurrentValues() override
QQmlRefPointer< QQmlBoundSignalExpression > rewindExpression
QQmlRefPointer< QQmlBoundSignalExpression > reverseExpression
void saveOriginals() override
bool isReversable() override
QObject * specifiedObject
QString specifiedProperty
QQuickState * state() const
bool isStateActive() const
void removeAllEntriesFromRevertList(QObject *target)
bool removeEntryFromRevertList(QObject *target, const QString &name)
void addEntryToRevertList(const QQuickStateAction &action)
void addEntriesToRevertList(const QList< QQuickStateAction > &actions)
bool changeBindingInRevertList(QObject *target, const QString &name, QQmlAnyBinding binding)
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool isEmpty() const
Returns true if the URL has no data; otherwise returns false.
const CompiledObject * objectAt(int index) const
QVector< QV4::Function * > runtimeFunctions
QString bindingValueAsString(const CompiledData::Binding *binding) const
static auto fromValue(T &&value) noexcept(std::is_nothrow_copy_constructible_v< T > &&Private::CanUseInternalSpace< T >) -> std::enable_if_t< std::conjunction_v< std::is_copy_constructible< T >, std::is_destructible< T > >, QVariant >
QSet< QString >::iterator it
Combined button and popup list for selecting options.
std::pair< T1, T2 > QPair
DBusConnection const char DBusError * error
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLsizei const GLfloat * v
[13]
GLuint64 GLenum void * handle
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLsizei const GLenum * props
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLenum GLsizei void GLsizei void * column
GLdouble GLdouble GLdouble GLdouble q
constexpr decltype(auto) qMakePair(T1 &&value1, T2 &&value2) noexcept(noexcept(std::make_pair(std::forward< T1 >(value1), std::forward< T2 >(value2))))
QQmlEngine * qmlEngine(const QObject *obj)
QQmlContext * qmlContext(const QObject *obj)
Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me)
QUrl url("example.com")
[constructor-url-reference]
engine evaluate("var myObject = new MyObject()")
[8]
\inmodule QtCore \reentrant
quint32_le propertyNameIndex
bool isSignalHandler() const
union QV4::CompiledData::Binding::@543 value
bool isTranslationBinding() const
bool valueAsBoolean() const
quint32_le compiledScriptIndex
QString stringAt(uint index) const
double bindingValueAsNumber(const CompiledData::Binding *binding) const
const Binding * bindingTable() const
ExecutionContext * rootContext() const
static Heap::QmlContext * create(QV4::ExecutionContext *parent, QQmlRefPointer< QQmlContextData > context, QObject *scopeObject)
static bool isSignalPropertyName(const QString &name)