aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor/abstractmetalang.h
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-03-21 09:29:58 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-04-19 10:36:17 +0000
commit6bb7322e47196186375a3733e9112860817ebb1d (patch)
tree72ad9417342894e4ea76062284c5fcb80c7081ec /sources/shiboken2/ApiExtractor/abstractmetalang.h
parent06fe31fd68823b53bbd0657e4bd63ef06b35137d (diff)
shiboken: Detect class enums by Clang entirely
The Clang function clang_EnumDecl_isScoped() tells whether an enum is a class, so, there is no need to specify that in the typesystem. Use that information to pass it up to the metalang classes and revert the parts of 44cb6c51e6c3b43376f284941454dc8c13b81c3f that added it to the type system. Task-number: PYSIDE-487 Change-Id: Ie10885f74168821d0307e91b6f1f7f3f30dd074b Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/abstractmetalang.h')
-rw-r--r--sources/shiboken2/ApiExtractor/abstractmetalang.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/sources/shiboken2/ApiExtractor/abstractmetalang.h b/sources/shiboken2/ApiExtractor/abstractmetalang.h
index 45a55e570..c51f7704b 100644
--- a/sources/shiboken2/ApiExtractor/abstractmetalang.h
+++ b/sources/shiboken2/ApiExtractor/abstractmetalang.h
@@ -1168,6 +1168,11 @@ public:
return package() + QLatin1Char('.') + qualifier() + QLatin1Char('.') + name();
}
+ EnumKind enumKind() const { return m_enumKind; }
+ void setEnumKind(EnumKind kind) { m_enumKind = kind; }
+
+ bool isAnonymous() const { return m_enumKind == AnonymousEnum; }
+
// Has the enum been declared inside a Q_ENUMS() macro in its enclosing class?
void setHasQEnumsDeclaration(bool on)
{
@@ -1199,13 +1204,12 @@ public:
m_class = c;
}
- bool isAnonymous() const;
-
private:
AbstractMetaEnumValueList m_enumValues;
EnumTypeEntry *m_typeEntry = nullptr;
AbstractMetaClass *m_class = nullptr;
+ EnumKind m_enumKind = CEnum;
uint m_hasQenumsDeclaration : 1;
};