diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-02-28 10:30:27 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-02-28 14:01:37 +0000 |
commit | 44cb6c51e6c3b43376f284941454dc8c13b81c3f (patch) | |
tree | 7e9fda1ba3788a3b9ed051e853b08926d325df6f /sources/shiboken2/libshiboken/sbkenum.h | |
parent | 7c83f2ebc1ac55c6e2556c8c852716502dcdba5a (diff) |
Type system: Add attribute indicating C++ 11 enum classes
Introduce enumeration for the type to EnumTypeEntry which can be specified
by the boolean "class" attribute. For the enum classes, the value names
need to be qualified by the enum name to match the C++ API.
For the C++ generator, add an overload to
Shiboken::createScopedEnumItem() that takes a PyTypeObject and add the enum
items to the enum so that the name is in the enum scope.
Change-Id: Ia0e469d13b08c196b9ddd965b9cf3cc62a38630b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'sources/shiboken2/libshiboken/sbkenum.h')
-rw-r--r-- | sources/shiboken2/libshiboken/sbkenum.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sources/shiboken2/libshiboken/sbkenum.h b/sources/shiboken2/libshiboken/sbkenum.h index 4b572dbcc..b01114ba6 100644 --- a/sources/shiboken2/libshiboken/sbkenum.h +++ b/sources/shiboken2/libshiboken/sbkenum.h @@ -95,6 +95,8 @@ namespace Enum */ LIBSHIBOKEN_API bool createGlobalEnumItem(PyTypeObject* enumType, PyObject* module, const char* itemName, long itemValue); /// This function does the same as createGlobalEnumItem, but adds the enum to a Shiboken type or namespace. + LIBSHIBOKEN_API bool createScopedEnumItem(PyTypeObject *enumType, PyTypeObject *scope, + const char *itemName, long itemValue); LIBSHIBOKEN_API bool createScopedEnumItem(PyTypeObject* enumType, SbkObjectType* scope, const char* itemName, long itemValue); LIBSHIBOKEN_API PyObject* newItem(PyTypeObject* enumType, long itemValue, const char* itemName = 0); |