QmlJS: Autocomplete dot and colon for properties.

Reviewed-by: Roberto Raggi
This commit is contained in:
Christian Kamm
2010-06-07 17:33:44 +02:00
parent d0d61182cb
commit 3b8b6e89cc
6 changed files with 98 additions and 67 deletions

View File

@@ -911,6 +911,23 @@ bool QmlObjectValue::enumContainsKey(const QString &enumName, const QString &enu
return false;
}
// Returns true if this object is in a package or if there is an object that
// has this one in its prototype chain and is itself in a package.
bool QmlObjectValue::hasChildInPackage() const
{
if (!packageName().isEmpty())
return true;
foreach (const FakeMetaObject *other, MetaTypeSystem::_metaObjects) {
if (other->packageName().isEmpty())
continue;
for (const FakeMetaObject *iter = other; iter; iter = iter->superClass()) {
if (iter == _metaObject) // this object is a parent of other
return true;
}
}
return false;
}
bool QmlObjectValue::isDerivedFrom(const FakeMetaObject *base) const
{
for (const FakeMetaObject *iter = _metaObject; iter; iter = iter->superClass()) {