diff --git a/src/libs/languageutils/fakemetaobject.cpp b/src/libs/languageutils/fakemetaobject.cpp index 7b8eb48607f1215e23a6b4f33154f178f963cb96..a478b2171a1cb0ab3847cd4483bff788bf1954b1 100644 --- a/src/libs/languageutils/fakemetaobject.cpp +++ b/src/libs/languageutils/fakemetaobject.cpp @@ -208,6 +208,13 @@ int FakeMetaObject::methodOffset() const { return 0; } FakeMetaMethod FakeMetaObject::method(int index) const { return m_methods.at(index); } +int FakeMetaObject::methodIndex(const QString &name) const //If performances becomes an issue, just use a nameToIdx hash +{ + for (int i=0; i<m_methods.count(); i++) + if (m_methods[i].methodName() == name) + return i; + return -1; +} QString FakeMetaObject::defaultPropertyName() const { return m_defaultPropertyName; } diff --git a/src/libs/languageutils/fakemetaobject.h b/src/libs/languageutils/fakemetaobject.h index 31a474d0fdd7b042a962fae67fac97d72c3adefb..c0a417a7e119202319b35631f62f6550fa4bea2b 100644 --- a/src/libs/languageutils/fakemetaobject.h +++ b/src/libs/languageutils/fakemetaobject.h @@ -188,6 +188,7 @@ public: int methodCount() const; int methodOffset() const; FakeMetaMethod method(int index) const; + int methodIndex(const QString &name) const; // Note: Returns any method with that name in case of overloads QString defaultPropertyName() const; void setDefaultPropertyName(const QString &defaultPropertyName);