IDE doesn't recognize the method

77 views Asked by At

I'm trying to acces the cityMethod() inside the class City.

class City
{
    void cityMethod() { }
}

So, I do:

map<string,City> mymap;
City c;
mymap["Madrid"] = c;

Now, when I do this:

mymap["Madrid"].cityMethod();

Ok, it works. But the IDE(Qt) doesn't recognize the "cityMethod". Am I doing something wrong? Is that compiler issue?

1

There are 1 answers

5
Lukas W On BEST ANSWER

This feature does not seem to be supported by Qt Creator. There's an open issue about it on http://bugreports.qt.io/.

It does work when using the ClangCodeModel plugin though. To use it, go to Help > About Plugins and activate the plugin there:

enter image description here

Then, enable its use in the options. Tools > Options > C++ > Code Model

enter image description here

You might experience performance issues with the Clang code model, but it does work:

enter image description here