diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-09-17 11:36:38 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-09-24 13:52:35 +0200 |
commit | 56c24b5d1aa507c62bdf3af917519e6c7cf7718c (patch) | |
tree | a94522e345d17e5492bd49a82a4089038fb7ebaa /sources/shiboken6/ApiExtractor/typesystem.h | |
parent | bce1bfb3af99aeb24259df34d662e8fcf072d3fd (diff) |
shiboken6: Add built-in CPython types
Add the CPython types along with their check functions.
Introduce a new Python type entry for this.
[ChangeLog][shiboken6] CPython types like PyObject, PySequence
are now built into shiboken6 and no longer need to be specified
in the typesystem files.
Task-number: PYSIDE-1660
Change-Id: Ia2a7e5445c11b99cae069818aa5b0e1aa169533c
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/typesystem.h')
-rw-r--r-- | sources/shiboken6/ApiExtractor/typesystem.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sources/shiboken6/ApiExtractor/typesystem.h b/sources/shiboken6/ApiExtractor/typesystem.h index 1ab27b4f4..fcd0abe99 100644 --- a/sources/shiboken6/ApiExtractor/typesystem.h +++ b/sources/shiboken6/ApiExtractor/typesystem.h @@ -102,6 +102,7 @@ public: ArrayType, TypeSystemType, CustomType, + PythonType, FunctionType, SmartPointerType, TypedefType @@ -297,10 +298,33 @@ public: QString checkFunction() const; void setCheckFunction(const QString &f); +#ifndef QT_NO_DEBUG_STREAM + void formatDebug(QDebug &d) const override; +#endif + protected: explicit CustomTypeEntry(TypeEntryPrivate *d); }; +class PythonTypeEntry : public CustomTypeEntry +{ +public: + explicit PythonTypeEntry(const QString &entryName, + const QString &checkFunction, + TypeSystem::CPythonType type); + + TypeEntry *clone() const override; + + TypeSystem::CPythonType cPythonType() const; + +#ifndef QT_NO_DEBUG_STREAM + void formatDebug(QDebug &d) const override; +#endif + +protected: + explicit PythonTypeEntry(TypeEntryPrivate *d); +}; + class TypeSystemTypeEntry : public TypeEntry { public: |