forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user