summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qdeclarativecontext.cpp
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2010-03-24 05:38:44 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2010-03-24 05:38:44 (GMT)
commit7e0711bd85d28204c1405928cfc68a2fd76f3d13 (patch)
treea78c8bdfa364e54801b9a3382df4a96ff62eba1a /src/declarative/qml/qdeclarativecontext.cpp
parent4b6b7361a6f8ba81b969134ca3251fad8543ddb0 (diff)
parentf59619a3a4de074d0557ce17f9580a242e4e6c16 (diff)
downloadQt-7e0711bd85d28204c1405928cfc68a2fd76f3d13.zip
Qt-7e0711bd85d28204c1405928cfc68a2fd76f3d13.tar.gz
Qt-7e0711bd85d28204c1405928cfc68a2fd76f3d13.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'src/declarative/qml/qdeclarativecontext.cpp')
-rw-r--r--src/declarative/qml/qdeclarativecontext.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/declarative/qml/qdeclarativecontext.cpp b/src/declarative/qml/qdeclarativecontext.cpp
index 85896c4..2b8cf70 100644
--- a/src/declarative/qml/qdeclarativecontext.cpp
+++ b/src/declarative/qml/qdeclarativecontext.cpp
@@ -724,6 +724,21 @@ void QDeclarativeContextData::setIdPropertyData(QDeclarativeIntegerCache *data)
idValues = new ContextGuard[idValueCount];
}
+QString QDeclarativeContextData::findObjectId(const QObject *obj) const
+{
+ if (!idValues || !propertyNames)
+ return QString();
+
+ for (int i=0; i<idValueCount; i++) {
+ if (idValues[i] == obj)
+ return propertyNames->findId(i);
+ }
+
+ if (linkedContext)
+ return linkedContext->findObjectId(obj);
+ return QString();
+}
+
QDeclarativeContext *QDeclarativeContextData::asQDeclarativeContext()
{
if (!publicContext)