[Interest] MOC and QT_VERSION_CHECK bug??

Thiago Macieira thiago.macieira at intel.com
Fri Aug 23 19:39:23 CEST 2013

On sexta-feira, 23 de agosto de 2013 14:26:44, Carel Combrink wrote:
> I am trying to get code to compile with both Qt 4 and Qt 5 bit it seems
> like MOC in Qt 4 (or qmake) does not understand QT_VERSION_CHECK and I get
> some strange outputs in the MOC file.

In Qt 4, moc does not expand macros. So when you write 
QT_VERSION_CHECK(5,0,0), it *really* sees that, with no expansion, and doesn't 
know whether it's true or false.

You should compare QT_VERSION to an actual number. Qt 5.0 was 0x50000.

Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130823/59cbb7fb/attachment.sig>

More information about the Interest mailing list