forked from qt-creator/qt-creator
QmlJS: Autocomplete dot and colon for properties.
Reviewed-by: Roberto Raggi
This commit is contained in:
@@ -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()) {
|
||||
|
||||
@@ -404,6 +404,7 @@ public:
|
||||
bool isListProperty(const QString &name) const;
|
||||
bool isEnum(const QString &typeName) const;
|
||||
bool enumContainsKey(const QString &enumName, const QString &enumKeyName) const;
|
||||
bool hasChildInPackage() const;
|
||||
|
||||
protected:
|
||||
const Value *findOrCreateSignature(int index, const FakeMetaMethod &method, QString *methodName) const;
|
||||
@@ -531,6 +532,8 @@ public:
|
||||
|
||||
private:
|
||||
QHash<QString, QList<QmlObjectValue *> > _importedTypes;
|
||||
|
||||
friend class QmlObjectValue;
|
||||
};
|
||||
|
||||
class ConvertToNumber: protected ValueVisitor // ECMAScript ToInt()
|
||||
|
||||
Reference in New Issue
Block a user