aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--abstractmetalang.cpp14
-rw-r--r--abstractmetalang.h1
2 files changed, 11 insertions, 4 deletions
diff --git a/abstractmetalang.cpp b/abstractmetalang.cpp
index ccb7352a4..351abea06 100644
--- a/abstractmetalang.cpp
+++ b/abstractmetalang.cpp
@@ -1323,10 +1323,16 @@ void AbstractMetaClass::setBaseClass(AbstractMetaClass *baseClass)
bool AbstractMetaClass::hasFunction(const QString &str) const
{
- foreach (const AbstractMetaFunction *f, functions())
- if (f->name() == str)
- return true;
- return false;
+ return findFunction(str);
+}
+
+const AbstractMetaFunction* AbstractMetaClass::findFunction(const QString& functionName) const
+{
+ foreach (const AbstractMetaFunction *f, functions()) {
+ if (f->name() == functionName)
+ return f;
+ }
+ return 0;
}
/* Returns true if this class has one or more functions that are
diff --git a/abstractmetalang.h b/abstractmetalang.h
index d53c5656a..6adb73739 100644
--- a/abstractmetalang.h
+++ b/abstractmetalang.h
@@ -1332,6 +1332,7 @@ public:
void addFunction(AbstractMetaFunction *function);
bool hasFunction(const AbstractMetaFunction *f) const;
bool hasFunction(const QString &str) const;
+ const AbstractMetaFunction* findFunction(const QString& functionName) const;
bool hasSignal(const AbstractMetaFunction *f) const;
bool hasConstructors() const;