diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-06-08 14:35:41 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-06-08 14:35:41 (GMT) |
commit | 91323ecc5b884679e04b29072508fec6e765a666 (patch) | |
tree | f21d6803c2e6bf25c983ea4e21ff009e6d60ca05 /src/tools/moc/generator.cpp | |
parent | 14e4314b5c2cfddb1e92fa1fefeaf7bea2dd6b3a (diff) | |
parent | 4336436b8113d6a80428d70beda40a89713d04db (diff) | |
download | Qt-91323ecc5b884679e04b29072508fec6e765a666.zip Qt-91323ecc5b884679e04b29072508fec6e765a666.tar.gz Qt-91323ecc5b884679e04b29072508fec6e765a666.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'src/tools/moc/generator.cpp')
-rw-r--r-- | src/tools/moc/generator.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index e94bb77..e4ad068 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -109,6 +109,14 @@ bool isVariantType(const char* type) return qvariant_nameToType(type) != 0; } +/*! + Returns true if the type is qreal. +*/ +static bool isQRealType(const char *type) +{ + return strcmp(type, "qreal") == 0; +} + Generator::Generator(ClassDef *classDef, const QList<QByteArray> &metaTypes, FILE *outfile) : out(outfile), cdef(classDef), metaTypes(metaTypes) { @@ -545,7 +553,7 @@ void Generator::generateProperties() uint flags = Invalid; if (!isVariantType(p.type)) { flags |= EnumOrFlag; - } else { + } else if (!isQRealType(p.type)) { flags |= qvariant_nameToType(p.type) << 24; } if (!p.read.isEmpty()) @@ -589,10 +597,12 @@ void Generator::generateProperties() if (p.notifyId != -1) flags |= Notify; - fprintf(out, " %4d, %4d, 0x%.8x,\n", - strreg(p.name), - strreg(p.type), - flags); + fprintf(out, " %4d, %4d, ", + strreg(p.name), + strreg(p.type)); + if (!(flags >> 24) && isQRealType(p.type)) + fprintf(out, "(QMetaType::QReal << 24) | "); + fprintf(out, "0x%.8x,\n", flags); } if(cdef->notifyableProperties) { |