Look at the enumerators when populating the completion box.

This commit is contained in:
Roberto Raggi
2010-01-28 15:50:58 +01:00
parent fc77c277be
commit da81d59e24
3 changed files with 28 additions and 2 deletions

View File

@@ -89,8 +89,13 @@ public:
}
};
QmlObjectValue::QmlObjectValue(const QMetaObject *metaObject, const QString &qmlTypeName, int majorVersion, int minorVersion, Engine *engine)
: ObjectValue(engine), _metaObject(metaObject), _qmlTypeName(qmlTypeName), _majorVersion(majorVersion), _minorVersion(minorVersion)
QmlObjectValue::QmlObjectValue(const QMetaObject *metaObject, const QString &qmlTypeName,
int majorVersion, int minorVersion, Engine *engine)
: ObjectValue(engine),
_metaObject(metaObject),
_qmlTypeName(qmlTypeName),
_majorVersion(majorVersion),
_minorVersion(minorVersion)
{
setClassName(qmlTypeName); // ### TODO: we probably need to do more than just this...
}
@@ -139,6 +144,14 @@ void QmlObjectValue::processMembers(MemberProcessor *processor) const
processor->processProperty(prop.name(), propertyValue(prop));
}
for (int index = _metaObject->enumeratorOffset(); index < _metaObject->propertyCount(); ++index) {
QMetaEnum e = _metaObject->enumerator(index);
for (int i = 0; i < e.keyCount(); ++i) {
processor->processEnumerator(QString::fromUtf8(e.key(i)), engine()->numberValue());
}
}
for (int index = 0; index < _metaObject->methodCount(); ++index) {
QMetaMethod method = _metaObject->method(index);
@@ -657,6 +670,11 @@ bool MemberProcessor::processProperty(const QString &, const Value *)
return true;
}
bool MemberProcessor::processEnumerator(const QString &, const Value *)
{
return true;
}
bool MemberProcessor::processSignal(const QString &, const Value *)
{
return true;