Mark Qt signals and slots as such in the DUChain.
This is a first step towards bringing back the old KDevelop 4 level of support for Qt. There is a lot of work left to be done though. This patch so far only marks class function declarations that are Qt slots or signals as such. The main idea here is taken from the Qt Creator clang code model, so credit where credit is due: Good job! When a TU is parsed that contains a system include path that ends with /QtCore we prepend the include paths to our "wrappedQtHeaders" folder. This so far only contains "QtCore/qobjectdefs.h" which includes the real "qobjectdefs.h" via `#include_next`. Then we redefine the MOC macros for signals and slots to inject __attribute__((annotate()) tokens with qt_slot/qt_signal contents where appropriate. This can then be looked up when traversing the AST via CXCursor_AnnotateAttr cursors. CCBUG: 354854
parent
fb3984ee
Please register or sign in to comment