Doxygen for QML components

Aurélien Gâteau agateau at kde.org
Wed Oct 17 14:58:24 UTC 2012


Le mercredi 17 octobre 2012 16:20:26 Aleix Pol a écrit :
> > The crude, done in 10 minutes one:
> > Define a custom comment to set on the property alias to document the type.
> > 
> > Something like this:
> >   property alias text: label.text // doxyqml: type=string
> > 
> > I consider the second option more in line with the phylosophy of the
> > current code :), so I am probably going to implement it that way, unless
> > one of you has a smarter idea.
> > 
> > An interesting bonus point of this annotation is that it could be used to
> > provide more precise information about the type. For example a property
> > which> 
> > takes a QtObject but actually expects a model could be marked as such:
> >   property QtObject model // doxyqml: type=QAbstractItemModel
 
> Just FWIW, it's what they do with Python and PHP as well (at least).
> We even use that information for type inference from KDevelop.
> 
> Maybe you can get inspired with what syntax they use there, though.

Ah, so I am not completely smocking crack there :) Using a similar syntax 
makes sense indeed. Do you have an example of such comments?

Aurélien


More information about the Plasma-devel mailing list