Skip to content

Commit f6f6fac

Browse files
author
florianlink
committed
created wrapper Q_ENUM/QFLAGS when enum is used in flags, to catch Q_ENUM uses without Q_FLAGS declaration
git-svn-id: http://svn.code.sf.net/p/pythonqt/code/trunk@441 ea8d5007-eb21-0410-b261-ccb3ea6e24a9
1 parent ac0c4bf commit f6f6fac

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

generator/shellheadergenerator.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,11 @@ void ShellHeaderGenerator::write(QTextStream &s, const AbstractMetaClass *meta_c
267267
QList<FlagsTypeEntry*> flags;
268268
foreach(AbstractMetaEnum* enum1, enums1) {
269269
// catch gadgets and enums that are not exported on QObjects...
270-
if ((enum1->wasProtected() || enum1->wasPublic()) && (!meta_class->isQObject() || !enum1->hasQEnumsDeclaration())) {
270+
// since we don't parse Q_FLAG(S), we also need to generate for Q_ENUM which might
271+
// have a missing Q_FLAG(S) declaration.
272+
if ((enum1->wasProtected() || enum1->wasPublic()) &&
273+
(!meta_class->isQObject() || !enum1->hasQEnumsDeclaration() || enum1->typeEntry()->flags()))
274+
{
271275
enums << enum1;
272276
if (enum1->typeEntry()->flags()) {
273277
flags << enum1->typeEntry()->flags();

0 commit comments

Comments
 (0)