<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">2015-09-06 6:04 GMT-07:00 Arno Rehn <span dir="ltr"><<a href="mailto:arno@arnorehn.de" target="_blank">arno@arnorehn.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Second, I don't know how to handle the Qt macros like "signals", "slots", etc. which expand to basic C++ (or even nothing at all). Maybe a proper handling would need some extensions to the parser itself.</blockquote></div><br><br></div><div class="gmail_extra">This blog post [1] may provide some help.  His general approach is to use the clang PPCallbacks class to detect whenever qobjectdefs.h has just been read (which defines the initial version of the signals and slots macros), and then redefine these macros so that each method is annotated as being a signal or slot:<br><br>#define Q_SIGNAL __attribute__((annotate("qt_signal")))<br>#define Q_SLOT __attribute__((annotate("qt_slot")))<br><br>Now the information is stored in the AST as metadata on the associated method.<br><br></div><div class="gmail_extra">I'm not sure of the details, I'm sure in practice it gets more complicated.<br></div><div class="gmail_extra"><br></div><div class="gmail_extra"></div><div class="gmail_extra">[1] <a href="http://woboq.com/blog/moc-with-clang.html" target="_blank">http://woboq.com/blog/moc-with-clang.html</a><br><br>-Chris<br><br></div></div>