diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-08-02 13:10:38 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-08-03 14:29:22 +0000 |
commit | 711515d089574cdc8be63c65d6b01863aadba141 (patch) | |
tree | 3e9ea0ad7ec2da8c94e6b91862d4e7b2670ce863 /sources/shiboken2/ApiExtractor/abstractmetalang.h | |
parent | 138815277a415595c669793383c2a4fc8c44d132 (diff) |
shiboken: Refactor code involved in inheriting template classes
- Add a helper template to conveniently search for a MetaClass by name
and convenience function to search in lists.
- Remove parameter bool *ok from
AbstractMetaBuilderPrivate::inheritTemplateType() and check on returned
pointer instead.
- In the inheritTemplate*() functions, use QScopedPointer to ensure
the result is deleted on failure.
- Search for a shadowing function first before creating the copy
in inheritTemplate().
Task-number: PYSIDE-725
Change-Id: I3183087fb42b22a2189c17b94eaafdb4c1151f0e
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/abstractmetalang.h')
-rw-r--r-- | sources/shiboken2/ApiExtractor/abstractmetalang.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sources/shiboken2/ApiExtractor/abstractmetalang.h b/sources/shiboken2/ApiExtractor/abstractmetalang.h index f55f61eb4..54a3549d0 100644 --- a/sources/shiboken2/ApiExtractor/abstractmetalang.h +++ b/sources/shiboken2/ApiExtractor/abstractmetalang.h @@ -727,6 +727,9 @@ public: AbstractMetaField *copy() const; + static AbstractMetaField * + find(const AbstractMetaFieldList &haystack, const QString &needle); + private: mutable AbstractMetaFunction *m_getter = nullptr; mutable AbstractMetaFunction *m_setter = nullptr; @@ -1079,6 +1082,9 @@ public: bool isCallOperator() const; + static AbstractMetaFunction * + find(const AbstractMetaFunctionList &haystack, const QString &needle); + #ifndef QT_NO_DEBUG_STREAM void formatDebugVerbose(QDebug &d) const; #endif @@ -1409,6 +1415,8 @@ public: m_fields << field; } + AbstractMetaField *findField(const QString &name) const; + AbstractMetaEnumList enums() const { return m_enums; |