On Jul 7, 2011, at 15:22, ext Konstantin Tokarev wrote:

> 
> 
> 07.07.2011, 17:16, [email protected]:
>> My current implementation idea is to redefine Q_SLOT, slots, signals, and 
>> Q_SIGNAL to expand to an __attribute__, pick that up in the parser, and 
>> annotate the AST.
> 
> How do you redefine slots and signals? They apply to several methods so 
> simple macro substitution won't work.

Yes, that why those two are the most "exciting" macros. So the quick 
description is to use a custom qobjectdefs.h containing:

#define signals protected __attribute__((q_signal))
#define slots __attribute__((q_slot))

Then in lib/Parse/ParseDeclCXX.cpp (in Clang (!)) store the trailing attributes 
in the AST node, and during code-completion, check for those attributes. I have 
a patch for clang to do this, but I think I want to play with it a bit in 
Creator first (read: verify that it works well). There is also another way to 
do this (check for macro expansions at the right places), but that is way more 
time-consuming.

Regards,
Erik.
-- 
Erik Verbruggen
Product manager Qt Creator
Nokia, Qt Development Frameworks

Nokia gate5 GmbH
Firmensitz: Invalidenstr. 117, 10115 Berlin, Germany
Registergericht: Amtsgericht Charlottenburg, Berlin: HRB 106443 B
Umsatzsteueridentifikationsnummer: DE 812 845 193
Geschäftsführer: Dr. Michael Halbherr, Karim Tähtivuori




_______________________________________________
Qt-creator mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt-creator

Reply via email to