diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-09-13 10:00:13 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-09-14 10:29:46 +0000 |
commit | 6bce0b92fa3fa29740d422d9f94ef1341ccf838f (patch) | |
tree | 149b2fbca60971b86dbaa8f00cf672b79dda369e /sources/shiboken2/ApiExtractor | |
parent | 28199f5870b4c7d45f5db54444a6cf597cfdd700 (diff) |
shiboken: Do not generate implicit conversions for array-modified constructors
Otherwise, syntax errors would be generated for
QMatrix2x2(const float*),
which is an array.
Change-Id: Ic5c67e221934a4635c2bbeb83cd378ff4a02af66
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/ApiExtractor')
-rw-r--r-- | sources/shiboken2/ApiExtractor/abstractmetalang.cpp | 12 | ||||
-rw-r--r-- | sources/shiboken2/ApiExtractor/abstractmetalang.h | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/sources/shiboken2/ApiExtractor/abstractmetalang.cpp b/sources/shiboken2/ApiExtractor/abstractmetalang.cpp index d289d943d..c6570059c 100644 --- a/sources/shiboken2/ApiExtractor/abstractmetalang.cpp +++ b/sources/shiboken2/ApiExtractor/abstractmetalang.cpp @@ -818,6 +818,18 @@ QString AbstractMetaFunction::typeReplaced(int key) const return QString(); } +bool AbstractMetaFunction::isModifiedToArray(int argumentIndex) const +{ + const FunctionModificationList &modifications = this->modifications(declaringClass()); + for (const FunctionModification &modification : modifications) { + for (const ArgumentModification &argumentModification : modification.argument_mods) { + if (argumentModification.index == argumentIndex && argumentModification.array != 0) + return true; + } + } + return false; +} + QString AbstractMetaFunction::minimalSignature() const { if (!m_cachedMinimalSignature.isEmpty()) diff --git a/sources/shiboken2/ApiExtractor/abstractmetalang.h b/sources/shiboken2/ApiExtractor/abstractmetalang.h index 08ab49d91..36a125f9d 100644 --- a/sources/shiboken2/ApiExtractor/abstractmetalang.h +++ b/sources/shiboken2/ApiExtractor/abstractmetalang.h @@ -1033,6 +1033,7 @@ public: TypeSystem::Ownership ownership(const AbstractMetaClass *cls, TypeSystem::Language language, int idx) const; QString typeReplaced(int argument_index) const; + bool isModifiedToArray(int argumentIndex) const; bool isRemovedFromAllLanguages(const AbstractMetaClass *) const; bool isRemovedFrom(const AbstractMetaClass *, TypeSystem::Language language) const; bool argumentRemoved(int) const; |