[Qt-creator] C++ Plugin: Check word against C++ Code Model

Carel Combrink carel.combrink at gmail.com
Fri May 10 15:27:29 CEST 2013


Hi,

I am busy with a Qt Creator plugin for the C++ Editor.

How do I use the C++ code model to check if a word is a function, class,
etc or 'just a word'? The plugin parses the comment tokens in a C++ Editor.

For an example: I have the following code:
/* This is function myFunction */
void myFunction(int arg1);

Parsing the comment gives me 4 words ("This", "is", "function" and
"myFunction"). How do I know that "This" is just a word while "myFunction"
is a token (part of the code model) in the scope of the comment?

My current, initial implementation checks a word against all tokens in the
file that the comment appears in. I would like to make use of the code
model instead, if possible.

Regards,
Carel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20130510/2cbb4086/attachment.html>


More information about the Qt-creator mailing list