In Qt Creator, if I have a QList<SomeClass*> called someList, and I type
someList[0].
it shows a list of all the members of SomeClass, and converts the “.” into “->”, which is great. However, if I do the same with an std::vector, I get no suggestions nor a conversion. I can still type out the code myself and it will work, though.
Is there any way I can make Qt Creator suggest the members of objects in non-Qt containers?
I’m using Qt Creator 2.4.1.
Creator actually parses the C++ code and ignores comments, so doxygen will not help here;-)
It will parse all files in your project as well as everything those include, using the include paths to find those if necessary.
No, there is currently no way to make Creator do that. The codemodel Creator uses is a bit limited when it comes to templates, so those tend to have no completion. It tends to fail rather often with QLists, too.
There is work ongoing to get that fixed by using the clang code model which is way more exact than the one we currently use, but unfortunately that is also way slower (not surprising as Creators will just take shortcuts wherever something takes too much time:-). Currently that is just not usable, it takes way too long to get the initial parsing that is required for code completion and syntax highlighting to work. We are looking at how this can be improved by either improving clang for our usecase or caching information or something.
Maybe we will just end up fixing up our existing code model a bit in the end or use ours for fast initial parsing and only follow up with clang later to improve on the data we extracted before.