aboutsummaryrefslogtreecommitdiffstats
path: root/share/qtcreator
diff options
context:
space:
mode:
authorIvan Donchevskii <ivan.donchevskii@qt.io>2018-01-26 15:12:38 +0100
committerIvan Donchevskii <ivan.donchevskii@qt.io>2018-02-20 06:49:47 +0000
commit66c7629814e01cf8ea213b06548eabcf32d1c206 (patch)
tree70730aa001fdef7090bac2da6dadbd23865de3c9 /share/qtcreator
parentb5f63a76b271d7dd46cf97b5bb9f990500cf34aa (diff)
Clang: Properly handle Q_PROPERTY in TokenInfo
Transform Q_PROPERTY into unique AST node. Mark different parts with types and search for parent in FullTokenInfos. Change-Id: Iaa1ec0c73d34773edf5605d3682bd6a290d195de Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Diffstat (limited to 'share/qtcreator')
-rw-r--r--share/qtcreator/cplusplus/wrappedQtHeaders/QtCore/qobjectdefs.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore/qobjectdefs.h b/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore/qobjectdefs.h
index 7408559858..84016ea9d0 100644
--- a/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore/qobjectdefs.h
+++ b/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore/qobjectdefs.h
@@ -23,11 +23,17 @@
**
****************************************************************************/
+#ifndef WRAPPED_QOBJECT_DEFS_H
+#define WRAPPED_QOBJECT_DEFS_H
+
// Include qobjectdefs.h from Qt ...
#include_next <qobjectdefs.h>
+#include <utility>
+
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wmacro-redefined"
+#pragma clang diagnostic ignored "-Wgnu-string-literal-operator-template"
// ...and redefine macros for tagging signals/slots
#ifdef signals
@@ -54,4 +60,15 @@
# define Q_SLOT __attribute__((annotate("qt_slot")))
#endif
+template <char... chars>
+using QPropertyMagicString = std::integer_sequence<char, chars...>;
+
+template <class T, T... chars>
+constexpr QPropertyMagicString<chars...> operator""_qpropstr() { return { }; }
+
+// Create unique AST node for the property.
+#define Q_PROPERTY(arg) void QPropertyMagicFunction(decltype(#arg ## _qpropstr));
+
#pragma clang diagnostic pop
+
+#endif // WRAPPED_QOBJECT_DEFS_H