File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -308,10 +308,10 @@ void ShellHeaderGenerator::write(QTextStream& s, const AbstractMetaClass* meta_c
308308 }
309309
310310 for (AbstractMetaEnum * enum1 : enums) {
311- s << " enum " << enum1->name () << " {" << endl;
311+ bool isEnumClass = enum1->typeEntry ()->isEnumClass ();
312+ s << " enum " << (isEnumClass ? " class " : " " ) << enum1->name () << " {" << endl;
312313 bool first = true ;
313314 QString scope = enum1->wasProtected () ? promoterClassName (meta_class) : meta_class->qualifiedCppName ();
314- bool isEnumClass = enum1->typeEntry ()->isEnumClass ();
315315 if (isEnumClass) {
316316 scope += " ::" + enum1->name ();
317317 }
@@ -321,12 +321,7 @@ void ShellHeaderGenerator::write(QTextStream& s, const AbstractMetaClass* meta_c
321321 else { s << " , " ; }
322322 QString assignedValue = scope + " ::" + value->name ();
323323 if (isEnumClass) {
324- // prepend value name with class name, the value name on itself could be a duplicate
325- //
326- // I thought about creating a enum class instead, and creating an Enum class in PythonQt for the wrapper
327- // (QMetaEnum has a isScoped method to check for enum classes),
328- // but the process seemed quite complicated.
329- s << " " << enum1->name () << " _" << value->name () << " = " << " static_cast<int>(" << scope << " ::" << value->name () << " )" ;
324+ s << " " << value->name () << " = " << " static_cast<int>(" << scope << " ::" << value->name () << " )" ;
330325 }
331326 else {
332327 s << " " << value->name () << " = " << scope << " ::" << value->name ();
You can’t perform that action at this time.
0 commit comments