Skip to content

Commit 96acb63

Browse files
committed
created wrapper Q_ENUM/QFLAGS when enum is used in flags, to catch Q_ENUM uses without Q_FLAGS declaration
1 parent 8e76e20 commit 96acb63

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)