swh:1:snp:673156c31a876c5b99b2fe3e89615529de9a3c44
Revision 6c54e10144e7af02f4c35e20e5f375a0cf280b8b authored by Olivier Goffart on 08 March 2016, 10:07:53 UTC, committed by Olivier Goffart (Woboq GmbH) on 06 April 2016, 14:36:48 UTC
This might be useful for IDE or other tools to be made aware of Qt macros.

This is inspired to what QtCreator[1] and moc-ng[2] does. But they are forced
to redefine or inject code at precise location which might be difficult.

This is going to make it easier to use libclang in qdoc.

With this change, the tooling can just predefine the macro QT_ANNOTATE_FUNCTION
and QT_ANNOTATE_CLASS to get what they need.

Example with libclang:
 "-DQT_ANNOTATE_CLASS(type,...)=static_assert(sizeof(#__VA_ARGS__),#type);"
 "-DQT_ANNOTATE_CLASS2(type,a1,a2)=static_assert(sizeof(#a1,#a2),#type);"
 "-DQT_ANNOTATE_FUNCTION(a)=__attribute__((annotate(#a)))"
 "-DQT_ANNOTATE_ACCESS_SPECIFIER(a)=__attribute__((annotate(#a)))"
 "-DQ_CLASSINFO(name,value)=static_assert(sizeof(name,value),\"qt_classinfo\");"
 "-DQ_REVISION(v)=__attribute__((annotate(\"qt_revision:\" QT_STRINGIFY2(v))))"

[1] qt-creator/cplusplus/wrappedQtHeaders/QtCore/qobjectdefs.h
[2] https://code.woboq.org/mocng/src/qobjectdefs-injected.h.html

Change-Id: I88fcb28f1dbb3d26ea82f10e9948e68a18c795e9
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
1 parent 58c23ae
History
Tip revision: ed928cee1233aee003610d5fadb56bdaeffbd7b2 authored by Jake Petroules on 22 September 2016, 17:55:20 UTC
Suppress deprecated warnings for some QSysInfo members
Tip revision: ed928ce
File Mode Size
bin
config.tests
dist
doc
examples
lib
mkspecs
qmake
src
tests
tools
util
.gitattributes -rw-r--r-- 151 bytes
.gitignore -rw-r--r-- 7.3 KB
.qmake.conf -rw-r--r-- 158 bytes
.tag -rw-r--r-- 12 bytes
INSTALL -rw-r--r-- 521 bytes
LGPL_EXCEPTION.txt -rw-r--r-- 1.2 KB
LICENSE.FDL -rw-r--r-- 22.4 KB
LICENSE.GPLv3 -rw-r--r-- 34.8 KB
LICENSE.LGPLv21 -rw-r--r-- 26.2 KB
LICENSE.LGPLv3 -rw-r--r-- 8.0 KB
LICENSE.PREVIEW.COMMERCIAL -rw-r--r-- 31.4 KB
configure -rwxr-xr-x 248.1 KB
configure.bat -rw-r--r-- 3.7 KB
header.BSD -rw-r--r-- 1.9 KB
header.COMM -rw-r--r-- 804 bytes
header.FDL -rw-r--r-- 1.2 KB
header.LGPL-ONLY -rw-r--r-- 936 bytes
header.LGPL21 -rw-r--r-- 1.5 KB
header.LGPL3 -rw-r--r-- 1.7 KB
header.LGPL3-COMM -rw-r--r-- 1.2 KB
qtbase.pro -rw-r--r-- 6.3 KB
sync.profile -rw-r--r-- 3.2 KB

back to top