aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/PySide2
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-07-09 14:04:54 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-07-13 10:38:16 +0200
commit7211180820d76814c7060d39d7ce0e9902865e14 (patch)
tree2b526a10c80a8d018d040e2c6e7465b6abf46754 /sources/pyside2/PySide2
parent3d98daaa90e9c7f7784d1a388d97039fcdeffdf1 (diff)
shiboken2: Re-add support for parsing Q_PROPERTY
Following how qdoc does it, define Q_PROPERTY as a static assert with the stringified macro content in a ','-operator and parse it with clang. Task-number: PYSIDE-1019 Change-Id: Idcf53f1cd1c1cb29f4320444f446e9abad33d251 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside2/PySide2')
-rw-r--r--sources/pyside2/PySide2/global.h.in7
1 files changed, 7 insertions, 0 deletions
diff --git a/sources/pyside2/PySide2/global.h.in b/sources/pyside2/PySide2/global.h.in
index ae1b103f5..a23b0f332 100644
--- a/sources/pyside2/PySide2/global.h.in
+++ b/sources/pyside2/PySide2/global.h.in
@@ -40,6 +40,13 @@
// Make "signals:", "slots:" visible as access specifiers
#define QT_ANNOTATE_ACCESS_SPECIFIER(a) __attribute__((annotate(#a)))
+// Q_PROPERTY is defined as class annotation which does not work since a
+// sequence of properties will to expand to a sequence of annotations
+// annotating nothing, causing clang to complain. Instead, define it away in a
+// static assert with the stringified argument in a ','-operator (cf qdoc).
+
+#define QT_ANNOTATE_CLASS(type,...) static_assert(sizeof(#__VA_ARGS__),#type);
+
#include <QtCore/qnamespace.h>
#if @ENABLE_X11@