From bec70b8845b9d642dc2cd29b8c85e8d06b107ea3 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 3 Jul 2018 12:10:50 +0200 Subject: shiboken: Streamline type parsing Extract a static AbstractMetaType *AbstractMetaBuilder::translateType() method from the existing AbstractMetaBuilderPrivate::translateType() which can be passed the current class. Internally, add a AbstractMetaBuilderPrivate::translateTypeStatic() method that takes AbstractMetaBuilderPrivate parameter. Use that in conjunction with the TypeParse code to remove the type parsing code in ShibokenGenerator::buildAbstractMetaTypeFromString(). Task-number: PYSIDE-672 Change-Id: Ia17f0eb542099dcb843a59708110fc9d90fab12f Reviewed-by: Alexandru Croitor --- sources/shiboken2/ApiExtractor/abstractmetabuilder_p.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'sources/shiboken2/ApiExtractor/abstractmetabuilder_p.h') diff --git a/sources/shiboken2/ApiExtractor/abstractmetabuilder_p.h b/sources/shiboken2/ApiExtractor/abstractmetabuilder_p.h index 59e3cfc94..7d4e280bd 100644 --- a/sources/shiboken2/ApiExtractor/abstractmetabuilder_p.h +++ b/sources/shiboken2/ApiExtractor/abstractmetabuilder_p.h @@ -123,7 +123,14 @@ public: int argumentIndex); AbstractMetaType *translateType(const AddedFunction::TypeInfo &typeInfo); AbstractMetaType *translateType(const TypeInfo &type, - bool resolveType = true); + bool resolveType = true, + QString *errorMessage = nullptr); + static AbstractMetaType *translateTypeStatic(const TypeInfo &type, + AbstractMetaClass *current, + AbstractMetaBuilderPrivate *d = nullptr, + bool resolveType = true, + QString *errorMessageIn = nullptr); + qint64 findOutValueFromString(const QString &stringValue, bool &ok); AbstractMetaClass *findTemplateClass(const QString& name, const AbstractMetaClass *context, -- cgit v1.2.3