diff options
author | Erik Verbruggen <erik.verbruggen@qt.io> | 2016-07-14 12:09:23 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2016-07-25 09:26:38 +0000 |
commit | 007ae316a62670eeff8b08526fad9110fff0bbd4 (patch) | |
tree | 142aa98565878d394935e85b91edf499279c9d8a /src/quick/util/qquickpropertychanges.cpp | |
parent | 4c1a51006e5936dc69e3373539787120092f6719 (diff) |
QML: Unify property reads/writes and use accessors
Pass property reads/writes through utility functions in QQmlProperty,
which in turn will try to use accessors when available (and no
interceptors have to be called).
Change-Id: I60ecfc202b6024bfe4a33206a46299787b152546
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/quick/util/qquickpropertychanges.cpp')
-rw-r--r-- | src/quick/util/qquickpropertychanges.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/quick/util/qquickpropertychanges.cpp b/src/quick/util/qquickpropertychanges.cpp index a42ec31058..c4be68cd31 100644 --- a/src/quick/util/qquickpropertychanges.cpp +++ b/src/quick/util/qquickpropertychanges.cpp @@ -597,7 +597,7 @@ void QQuickPropertyChanges::changeValue(const QString &name, const QVariant &val state()->addEntryToRevertList(action); QQmlAbstractBinding *oldBinding = QQmlPropertyPrivate::binding(action.property); if (oldBinding) - oldBinding->setEnabled(false, QQmlPropertyPrivate::DontRemoveBinding | QQmlPropertyPrivate::BypassInterceptor); + oldBinding->setEnabled(false, QQmlPropertyData::DontRemoveBinding | QQmlPropertyData::BypassInterceptor); d->property(name).write(value); } } @@ -631,7 +631,7 @@ void QQuickPropertyChanges::changeExpression(const QString &name, const QString &QQmlPropertyPrivate::get(prop)->core, expression, object(), qmlContext(this)); newBinding->setTarget(prop); - QQmlPropertyPrivate::setBinding(newBinding, QQmlPropertyPrivate::None, QQmlPropertyPrivate::DontRemoveBinding | QQmlPropertyPrivate::BypassInterceptor); + QQmlPropertyPrivate::setBinding(newBinding, QQmlPropertyPrivate::None, QQmlPropertyData::DontRemoveBinding | QQmlPropertyData::BypassInterceptor); } return; } @@ -644,7 +644,7 @@ void QQuickPropertyChanges::changeExpression(const QString &name, const QString if (hadValue) { QQmlAbstractBinding *oldBinding = QQmlPropertyPrivate::binding(d->property(name)); if (oldBinding) { - oldBinding->setEnabled(false, QQmlPropertyPrivate::DontRemoveBinding | QQmlPropertyPrivate::BypassInterceptor); + oldBinding->setEnabled(false, QQmlPropertyData::DontRemoveBinding | QQmlPropertyData::BypassInterceptor); state()->changeBindingInRevertList(object(), name, oldBinding); } @@ -653,7 +653,7 @@ void QQuickPropertyChanges::changeExpression(const QString &name, const QString &QQmlPropertyPrivate::get(prop)->core, expression, object(), qmlContext(this)); newBinding->setTarget(prop); - QQmlPropertyPrivate::setBinding(newBinding, QQmlPropertyPrivate::None, QQmlPropertyPrivate::DontRemoveBinding | QQmlPropertyPrivate::BypassInterceptor); + QQmlPropertyPrivate::setBinding(newBinding, QQmlPropertyPrivate::None, QQmlPropertyData::DontRemoveBinding | QQmlPropertyData::BypassInterceptor); } else { QQuickStateAction action; action.restore = restoreEntryValues(); @@ -679,9 +679,9 @@ void QQuickPropertyChanges::changeExpression(const QString &name, const QString state()->addEntryToRevertList(action); QQmlAbstractBinding *oldBinding = QQmlPropertyPrivate::binding(action.property); if (oldBinding) - oldBinding->setEnabled(false, QQmlPropertyPrivate::DontRemoveBinding | QQmlPropertyPrivate::BypassInterceptor); + oldBinding->setEnabled(false, QQmlPropertyData::DontRemoveBinding | QQmlPropertyData::BypassInterceptor); - QQmlPropertyPrivate::setBinding(newBinding, QQmlPropertyPrivate::None, QQmlPropertyPrivate::DontRemoveBinding | QQmlPropertyPrivate::BypassInterceptor); + QQmlPropertyPrivate::setBinding(newBinding, QQmlPropertyPrivate::None, QQmlPropertyData::DontRemoveBinding | QQmlPropertyData::BypassInterceptor); } } } |