diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2016-07-26 20:01:57 +0200 |
---|---|---|
committer | Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> | 2016-07-26 22:49:31 +0000 |
commit | c5a4b093d051680bf7f34bb5acff16eea9d4979f (patch) | |
tree | afc893b216ac8459a9b93bf5d4b0ccae4fd07cd2 /src/tools | |
parent | b27065014fb42c8f52b7d16d2436146421a51c33 (diff) | |
download | qtbase-c5a4b093d051680bf7f34bb5acff16eea9d4979f.tar.gz |
Add QMetaEnum::isScoped to be able to destinguish C++11 enum class
Change-Id: I67b1dbd069fa57bd60e50690abb5d876edc0d1d2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/moc/generator.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index 7de6fe632f..ccc6d795d7 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -878,9 +878,14 @@ void Generator::generateEnums(int index) int i; for (i = 0; i < cdef->enumList.count(); ++i) { const EnumDef &e = cdef->enumList.at(i); + int flags = 0; + if (cdef->enumDeclarations.value(e.name)) + flags |= EnumIsFlag; + if (e.isEnumClass) + flags |= EnumIsScoped; fprintf(out, " %4d, 0x%.1x, %4d, %4d,\n", stridx(e.name), - cdef->enumDeclarations.value(e.name) ? 1 : 0, + flags, e.values.count(), index); index += e.values.count() * 2; |