summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qdeclarativepropertycache.cpp
diff options
context:
space:
mode:
authorMorten Engvoldsen <morten.engvoldsen@nokia.com>2010-10-07 19:23:54 (GMT)
committerMorten Engvoldsen <morten.engvoldsen@nokia.com>2010-10-07 19:23:54 (GMT)
commit4f1d524f992b0df3626ab63c001345c96ccea766 (patch)
treeddc248c09fbb041b09792dae680b2f494e9b4e4b /src/declarative/qml/qdeclarativepropertycache.cpp
parent34c8022c216f6e298b0b0f8250cdf17688534c5b (diff)
parent161f15e1e79ec5f23244da68340ba1e78f3ac4bb (diff)
downloadQt-4f1d524f992b0df3626ab63c001345c96ccea766.zip
Qt-4f1d524f992b0df3626ab63c001345c96ccea766.tar.gz
Qt-4f1d524f992b0df3626ab63c001345c96ccea766.tar.bz2
Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
Diffstat (limited to 'src/declarative/qml/qdeclarativepropertycache.cpp')
-rw-r--r--src/declarative/qml/qdeclarativepropertycache.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/declarative/qml/qdeclarativepropertycache.cpp b/src/declarative/qml/qdeclarativepropertycache.cpp
index 08503c2..9e1ceb8 100644
--- a/src/declarative/qml/qdeclarativepropertycache.cpp
+++ b/src/declarative/qml/qdeclarativepropertycache.cpp
@@ -94,6 +94,8 @@ void QDeclarativePropertyCache::Data::load(const QMetaMethod &m)
{
coreIndex = m.methodIndex();
flags |= Data::IsFunction;
+ if (m.methodType() == QMetaMethod::Signal)
+ flags |= Data::IsSignal;
propType = QVariant::Invalid;
const char *returnType = m.typeName();
@@ -215,7 +217,7 @@ QDeclarativePropertyCache *QDeclarativePropertyCache::copy() const
}
void QDeclarativePropertyCache::append(QDeclarativeEngine *engine, const QMetaObject *metaObject,
- Data::Flag propertyFlags, Data::Flag methodFlags)
+ Data::Flag propertyFlags, Data::Flag methodFlags, Data::Flag signalFlags)
{
QDeclarativeEnginePrivate *enginePriv = QDeclarativeEnginePrivate::get(engine);
@@ -251,6 +253,8 @@ void QDeclarativePropertyCache::append(QDeclarativeEngine *engine, const QMetaOb
int methodCount = metaObject->methodCount();
int methodOffset = qMax(2, metaObject->methodOffset()); // 2 to block the destroyed signal
+
+ methodIndexCache.resize(methodCount);
for (int ii = methodOffset; ii < methodCount; ++ii) {
QMetaMethod m = metaObject->method(ii);
if (m.access() == QMetaMethod::Private)
@@ -272,6 +276,10 @@ void QDeclarativePropertyCache::append(QDeclarativeEngine *engine, const QMetaOb
data->load(m);
if (m.methodType() == QMetaMethod::Slot || m.methodType() == QMetaMethod::Method)
data->flags |= methodFlags;
+ else if (m.methodType() == QMetaMethod::Signal)
+ data->flags |= signalFlags;
+
+ methodIndexCache[ii] = data;
stringCache.insert(methodName, data);
identifierCache.insert(data->identifier.identifier, data);
@@ -350,6 +358,15 @@ QDeclarativePropertyCache::property(int index) const
}
QDeclarativePropertyCache::Data *
+QDeclarativePropertyCache::method(int index) const
+{
+ if (index < 0 || index >= methodIndexCache.count())
+ return 0;
+
+ return methodIndexCache.at(index);
+}
+
+QDeclarativePropertyCache::Data *
QDeclarativePropertyCache::property(const QString &str) const
{
return stringCache.value(str);