Skip to content
Snippets Groups Projects
Commit ccc19523 authored by Alan Alpert's avatar Alan Alpert
Browse files

Add methodIndex function


While not a complete feature, as it does not handle overloads,
it is still an improvement on the current functionality. Would be
a good interim measure until full functionality arrives.

Change-Id: I947adc6a6dbccf676112ac77e186134fb660efd3
Reviewed-by: default avatarFawzi Mohamed <fawzi.mohamed@digia.com>
parent b9fd359b
No related branches found
No related tags found
No related merge requests found
......@@ -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; }
......
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment