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>
23#include <QtQml/private/qqmlsignalnames_p.h>
25#include <private/qobject_p.h>
26#include <QtCore/qpointer.h>
181 QList<const QV4::CompiledData::Binding *>
bindings;
219 switch (binding->
type()) {
221 error(compilationUnit->objectAt(binding->
value.objectIndex),
222 QQuickPropertyChanges::tr(
223 "PropertyChanges does not support creating state-specific objects."));
229 for (
quint32 i = 0;
i < subObj->nBindings; ++
i, ++subBinding)
257 switch (binding->
type()) {
263 for (
quint32 i = 0;
i < subObj->nBindings; ++
i, ++subBinding) {
294 if (ddata && ddata->outerContext && !ddata->outerContext->url().isEmpty()) {
295 url = ddata->outerContext->
url();
296 line = ddata->lineNumber;
297 column = ddata->columnNumber;
305 id = binding->
value.compiledScriptIndex;
312 switch (binding->
type()) {
338 for (
int ii = 0; ii <
props.size(); ++ii)
347 p->compilationUnit = compilationUnit;
352 data->releaseDeferredData();
363 for(
int ii = 0; ii <
d->signalReplacements.size(); ++ii)
364 delete d->signalReplacements.at(ii);
376 if (
o !=
d->object) {
400 if (
v !=
d->restore) {
412 object,
property, ddata ? ddata->outerContext : QQmlRefPointer<QQmlContextData>(),
415 qmlWarning(
q) << QQuickPropertyChanges::tr(
"Cannot assign to non-existent property \"%1\"").arg(
property);
418 qmlWarning(
q) << QQuickPropertyChanges::tr(
"Cannot assign to read-only property \"%1\"").arg(
property);
432 for (
int ii = 0; ii <
d->properties.size(); ++ii) {
436 d->properties.at(ii).second);
438 if (
a.property.isValid()) {
444 for (
int ii = 0; ii <
d->signalReplacements.size(); ++ii) {
454 for (
int ii = 0; ii <
d->expressions.size(); ++ii) {
465 a.specifiedObject =
d->object;
477 std::unique_ptr<QQmlBinding> newBinding =
nullptr;
485 a.toValue = newBinding->evaluate();
492 d->compilationUnit->runtimeFunctions.at(e.
id),
498 a.toBinding = newBinding;
499 a.deletableToBinding =
true;
531 return d->isExplicit;
537 if (e !=
d->isExplicit) {
546 typedef QPair<QString, QVariant> PropertyEntry;
548 for (
const PropertyEntry &
entry :
d->properties) {
562 for (
const ExpressionEntry &
entry :
d->expressions) {
579 typedef QPair<QString, QVariant> PropertyEntry;
583 d->expressions.erase(
it);
589 d->properties.append(PropertyEntry(
name,
value));
611 d->properties.append(PropertyEntry(
name,
value));
626 bool hadValue =
false;
630 d->properties.erase(
it);
640 auto prop =
d->property(
name);
657 auto prop =
d->property(
name);
702 typedef QPair<QString, QVariant> PropertyEntry;
705 for (
const PropertyEntry &
entry :
d->properties) {
711 for (
const ExpressionEntry &
entry :
d->expressions) {
726 d->expressions.erase(
it);
734 d->properties.erase(
it);
744 typedef QPair<QString, QVariant> PropertyEntry;
746 for (
const PropertyEntry &
entry :
d->properties) {
760 for (
const ExpressionEntry &
entry :
d->expressions) {
783#include "moc_qquickpropertychanges_p.cpp"
static QObjectPrivate * get(QObject *o)
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)
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.
static bool isHandlerName(QStringView signalName)
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
QQuickStateActionEvent * event
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
QString url(FormattingOptions options=FormattingOptions(PrettyDecoded)) const
Returns a string representation of the URL.
QString toString(FormattingOptions options=FormattingOptions(PrettyDecoded)) const
Returns a string representation of the URL.
const CompiledObject * objectAt(int index) const
QString bindingValueAsString(const CompiledData::Binding *binding) const
double bindingValueAsNumber(const CompiledData::Binding *binding) const
QString stringAt(uint index) 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.
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]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLsizei const GLenum * props
GLenum GLenum GLsizei void GLsizei void * column
GLdouble GLdouble GLdouble GLdouble q
QT_BEGIN_NAMESPACE 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
QVector< QV4::Function * > runtimeFunctions
quint32_le propertyNameIndex
bool isSignalHandler() const
union QV4::CompiledData::Binding::@540 value
bool isTranslationBinding() const
bool valueAsBoolean() const
ExecutionContext * rootContext() const
static Heap::QmlContext * create(QV4::ExecutionContext *parent, QQmlRefPointer< QQmlContextData > context, QObject *scopeObject)