aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@theqtcompany.com>2015-04-16 11:56:07 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-04-27 07:44:43 +0000
commit80defcb0c01d747f331719c0f89992d6db660f98 (patch)
treebde0d4519047a9d791ae272e6c65c7772e34fe19 /src
parent0e14a46f60124d9da1101fe7766c7d85e2b72e64 (diff)
Get rid of QQmlBinding::property()
The method is slow and not required anymore Change-Id: I8c2bc6eeedbd15b901b60aa08408fe8c32a81707 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/qml/qml/qqmlbinding.cpp7
-rw-r--r--src/qml/qml/qqmlbinding_p.h1
-rw-r--r--src/qml/qml/qqmlproperty.cpp5
-rw-r--r--src/qml/qml/qqmlproperty_p.h3
-rw-r--r--src/quick/items/qquickstateoperations.cpp28
5 files changed, 22 insertions, 22 deletions
diff --git a/src/qml/qml/qqmlbinding.cpp b/src/qml/qml/qqmlbinding.cpp
index cfcca18d37..0e56a67cf7 100644
--- a/src/qml/qml/qqmlbinding.cpp
+++ b/src/qml/qml/qqmlbinding.cpp
@@ -217,7 +217,7 @@ void QQmlBinding::update(QQmlPropertyPrivate::WriteFlags flags)
if (!watcher.wasDeleted())
setUpdatingFlag(false);
} else {
- QQmlProperty p = property();
+ QQmlProperty p = QQmlPropertyPrivate::restore(targetObject(), m_core, 0);
QQmlAbstractBinding::printBindingLoopError(p);
}
}
@@ -334,9 +334,4 @@ void QQmlBinding::setTarget(QObject *object, const QQmlPropertyData &core)
}
}
-QQmlProperty QQmlBinding::property() const
-{
- return QQmlPropertyPrivate::restore(targetObject(), m_core, 0);
-}
-
QT_END_NAMESPACE
diff --git a/src/qml/qml/qqmlbinding_p.h b/src/qml/qml/qqmlbinding_p.h
index 6ffb5a756a..3dbf26d1a8 100644
--- a/src/qml/qml/qqmlbinding_p.h
+++ b/src/qml/qml/qqmlbinding_p.h
@@ -75,7 +75,6 @@ public:
void setTarget(const QQmlProperty &);
void setTarget(QObject *, const QQmlPropertyData &);
- QQmlProperty property() const;
void setNotifyOnValueChanged(bool);
diff --git a/src/qml/qml/qqmlproperty.cpp b/src/qml/qml/qqmlproperty.cpp
index cd59c2dd41..94b90e910a 100644
--- a/src/qml/qml/qqmlproperty.cpp
+++ b/src/qml/qml/qqmlproperty.cpp
@@ -768,6 +768,11 @@ static QQmlAbstractBinding *removeOldBinding(QObject *object, int index, QQmlPro
return oldBinding;
}
+QQmlAbstractBinding *QQmlPropertyPrivate::removeBinding(QQmlAbstractBinding *b, QQmlPropertyPrivate::BindingFlag flags)
+{
+ return removeBinding(b->targetObject(), b->targetPropertyIndex(), flags);
+}
+
QQmlAbstractBinding *QQmlPropertyPrivate::removeBinding(QObject *o, int index, QQmlPropertyPrivate::BindingFlag flags)
{
Q_ASSERT(o);
diff --git a/src/qml/qml/qqmlproperty_p.h b/src/qml/qml/qqmlproperty_p.h
index b6b5421999..9b735669b8 100644
--- a/src/qml/qml/qqmlproperty_p.h
+++ b/src/qml/qml/qqmlproperty_p.h
@@ -114,7 +114,8 @@ public:
static void setBinding(QQmlAbstractBinding *binding, BindingFlags flags = None, WriteFlags writeFlags = DontRemoveBinding);
static QQmlAbstractBinding *removeBinding(const QQmlProperty &that, BindingFlag flag = None);
- static QQmlAbstractBinding *removeBinding(QObject *o, int index, BindingFlag flag = None);
+ static QQmlAbstractBinding *removeBinding(QObject *o, int index, QQmlPropertyPrivate::BindingFlag flags = None);
+ static QQmlAbstractBinding *removeBinding(QQmlAbstractBinding *b, BindingFlag flag = None);
static QQmlAbstractBinding *binding(QObject *, int coreIndex,
int valueTypeIndex /* -1 */);
diff --git a/src/quick/items/qquickstateoperations.cpp b/src/quick/items/qquickstateoperations.cpp
index b2b9c75c25..3ea1c0ecf1 100644
--- a/src/quick/items/qquickstateoperations.cpp
+++ b/src/quick/items/qquickstateoperations.cpp
@@ -1053,19 +1053,19 @@ void QQuickAnchorChanges::execute(Reason reason)
//set any anchors that have been specified
if (d->leftBinding)
- QQmlPropertyPrivate::setBinding(d->leftBinding->property(), d->leftBinding);
+ QQmlPropertyPrivate::setBinding(d->leftBinding);
if (d->rightBinding)
- QQmlPropertyPrivate::setBinding(d->rightBinding->property(), d->rightBinding);
+ QQmlPropertyPrivate::setBinding(d->rightBinding);
if (d->hCenterBinding)
- QQmlPropertyPrivate::setBinding(d->hCenterBinding->property(), d->hCenterBinding);
+ QQmlPropertyPrivate::setBinding(d->hCenterBinding);
if (d->topBinding)
- QQmlPropertyPrivate::setBinding(d->topBinding->property(), d->topBinding);
+ QQmlPropertyPrivate::setBinding(d->topBinding);
if (d->bottomBinding)
- QQmlPropertyPrivate::setBinding(d->bottomBinding->property(), d->bottomBinding);
+ QQmlPropertyPrivate::setBinding(d->bottomBinding);
if (d->vCenterBinding)
- QQmlPropertyPrivate::setBinding(d->vCenterBinding->property(), d->vCenterBinding);
+ QQmlPropertyPrivate::setBinding(d->vCenterBinding);
if (d->baselineBinding)
- QQmlPropertyPrivate::setBinding(d->baselineBinding->property(), d->baselineBinding);
+ QQmlPropertyPrivate::setBinding(d->baselineBinding);
}
bool QQuickAnchorChanges::isReversable()
@@ -1083,49 +1083,49 @@ void QQuickAnchorChanges::reverse(Reason reason)
//reset any anchors set by the state
if (d->leftBinding) {
targetPrivate->anchors()->resetLeft();
- QQmlPropertyPrivate::removeBinding(d->leftBinding->property());
+ QQmlPropertyPrivate::removeBinding(d->leftBinding);
if (reason == ActualChange) {
d->leftBinding->destroy(); d->leftBinding = 0;
}
}
if (d->rightBinding) {
targetPrivate->anchors()->resetRight();
- QQmlPropertyPrivate::removeBinding(d->rightBinding->property());
+ QQmlPropertyPrivate::removeBinding(d->rightBinding);
if (reason == ActualChange) {
d->rightBinding->destroy(); d->rightBinding = 0;
}
}
if (d->hCenterBinding) {
targetPrivate->anchors()->resetHorizontalCenter();
- QQmlPropertyPrivate::removeBinding(d->hCenterBinding->property());
+ QQmlPropertyPrivate::removeBinding(d->hCenterBinding);
if (reason == ActualChange) {
d->hCenterBinding->destroy(); d->hCenterBinding = 0;
}
}
if (d->topBinding) {
targetPrivate->anchors()->resetTop();
- QQmlPropertyPrivate::removeBinding(d->topBinding->property());
+ QQmlPropertyPrivate::removeBinding(d->topBinding);
if (reason == ActualChange) {
d->topBinding->destroy(); d->topBinding = 0;
}
}
if (d->bottomBinding) {
targetPrivate->anchors()->resetBottom();
- QQmlPropertyPrivate::removeBinding(d->bottomBinding->property());
+ QQmlPropertyPrivate::removeBinding(d->bottomBinding);
if (reason == ActualChange) {
d->bottomBinding->destroy(); d->bottomBinding = 0;
}
}
if (d->vCenterBinding) {
targetPrivate->anchors()->resetVerticalCenter();
- QQmlPropertyPrivate::removeBinding(d->vCenterBinding->property());
+ QQmlPropertyPrivate::removeBinding(d->vCenterBinding);
if (reason == ActualChange) {
d->vCenterBinding->destroy(); d->vCenterBinding = 0;
}
}
if (d->baselineBinding) {
targetPrivate->anchors()->resetBaseline();
- QQmlPropertyPrivate::removeBinding(d->baselineBinding->property());
+ QQmlPropertyPrivate::removeBinding(d->baselineBinding);
if (reason == ActualChange) {
d->baselineBinding->destroy(); d->baselineBinding = 0;
}