diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2010-02-20 14:37:51 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2010-02-20 18:20:05 -0300 |
commit | 4d89c3d81477a730b7d7ce6c9b5c062ee8cd1ec7 (patch) | |
tree | ad6d249bd8d952bc8db3b31aaa3eb0f9279bcf41 /cppgenerator.h | |
parent | 08acf3d1c3f5fd364ebd29ae00f48b6f6ad2f97d (diff) |
All enums are now extensible to match the C++ casting behaviour.
Now the user can build new values of a particular enum type passing
an integer to its constructor. Thus, the following C++ code:
MyEnum val = (MyEnum) 1;
is the equivalent of this Python code:
val = MyEnum(1)
The enum unit tests were also updated.
Reviewed by Lauro Moura <lauro.neto@openbossa.org>
Diffstat (limited to 'cppgenerator.h')
-rw-r--r-- | cppgenerator.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/cppgenerator.h b/cppgenerator.h index a8d45344d..136a1fb71 100644 --- a/cppgenerator.h +++ b/cppgenerator.h @@ -134,6 +134,7 @@ private: void writeRichCompareFunction(QTextStream& s, const AbstractMetaClass* metaClass); void writeFlagsNewMethod(QTextStream& s, const FlagsTypeEntry* cppFlags); + void writeEnumNewMethod(QTextStream& s, const AbstractMetaEnum* cppEnum); void writeEnumDefinition(QTextStream& s, const AbstractMetaEnum* metaEnum); void writeEnumInitialization(QTextStream& s, const AbstractMetaEnum* metaEnum); |