aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlbinding.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@theqtcompany.com>2015-04-16 22:26:44 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-06-05 08:37:31 +0000
commit5ef5f1bb9eb282a122906d375e90632c6dcfcb35 (patch)
tree808088835d3507d61ddf330ed48340df2d905e9b /src/qml/qml/qqmlbinding.cpp
parent13ec9ab3b898a67403ce0031c4cfdc74d95d5560 (diff)
Move the target property index into the common base class
This unifies some more code between the different binding classes Change-Id: I891dc9358cf9598a0c1e21df8a62d6f8a4193985 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/qml/qqmlbinding.cpp')
-rw-r--r--src/qml/qml/qqmlbinding.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/qml/qml/qqmlbinding.cpp b/src/qml/qml/qqmlbinding.cpp
index ec9ac912b5..0f22bf4521 100644
--- a/src/qml/qml/qqmlbinding.cpp
+++ b/src/qml/qml/qqmlbinding.cpp
@@ -270,11 +270,6 @@ QString QQmlBinding::expression() const
return v->toQStringNoThrow();
}
-int QQmlBinding::targetPropertyIndex() const
-{
- return m_index;
-}
-
void QQmlBinding::setTarget(const QQmlProperty &prop)
{
setTarget(prop.object(), QQmlPropertyPrivate::get(prop)->core);
@@ -286,7 +281,7 @@ void QQmlBinding::setTarget(QObject *object, const QQmlPropertyData &core)
QQmlPropertyData pd = core;
if (!object) {
- m_index = -1;
+ m_targetIndex = -1;
return;
}
@@ -298,7 +293,7 @@ void QQmlBinding::setTarget(QObject *object, const QQmlPropertyData &core)
int aValueTypeIndex;
if (!vme->aliasTarget(coreIndex, &object, &coreIndex, &aValueTypeIndex)) {
m_target = 0;
- m_index = -1;
+ m_targetIndex = -1;
return;
}
if (valueTypeIndex == -1)
@@ -307,7 +302,7 @@ void QQmlBinding::setTarget(QObject *object, const QQmlPropertyData &core)
QQmlData *data = QQmlData::get(object, false);
if (!data || !data->propertyCache) {
m_target = 0;
- m_index = -1;
+ m_targetIndex = -1;
return;
}
QQmlPropertyData *propertyData = data->propertyCache->property(coreIndex);
@@ -325,7 +320,7 @@ void QQmlBinding::setTarget(QObject *object, const QQmlPropertyData &core)
pd.valueTypeCoreIndex = valueTypeIndex;
}
}
- m_index = pd.encodedIndex();
+ m_targetIndex = pd.encodedIndex();
QQmlData *data = QQmlData::get(*m_target, true);
if (!data->propertyCache) {
@@ -337,7 +332,7 @@ void QQmlBinding::setTarget(QObject *object, const QQmlPropertyData &core)
QQmlPropertyData QQmlBinding::getPropertyData() const
{
int coreIndex;
- int valueTypeIndex = QQmlPropertyData::decodeValueTypePropertyIndex(m_index, &coreIndex);
+ int valueTypeIndex = QQmlPropertyData::decodeValueTypePropertyIndex(m_targetIndex, &coreIndex);
QQmlData *data = QQmlData::get(*m_target, false);
Q_ASSERT(data && data->propertyCache);