Qt Creator - Code completion in implementation file
-
wrote on 9 Jan 2012, 00:38 last edited by
Hi,
It appears that code completion does not work in implementation files unless I specify the fully qualified name of the class for the method in question.
For example, the following will disable all code completion for the current class:
@using a::b::MyClass;
void MyClass::myMethod()
{
// code completion will not work for any instance variables or other methods in class
}@If I remove the using and re-declare the method as
@void a::b::MyClass::myMethod()
{
// code completion works as expected
}@Any reason why the first way is disabled in Qt Creator? I am a C++ newbie, so am not sure if the first method is considered bad style.
Thanks
Rakesh -
wrote on 9 Jan 2012, 05:09 last edited by
Which version of QtCreator are you using? I have not noticed this, and I define nearly all of my classes in a namespace and use "using" rather than full qualification of each method.
-
wrote on 9 Jan 2012, 10:54 last edited by
2.4.0 on Mac OS X Snow Leopard with Vim emulation enabled.
-
wrote on 9 Jan 2012, 12:17 last edited by
You should change your first line to
@
using namespace a::b;
@ -
wrote on 9 Jan 2012, 19:19 last edited by
Thanks, that does the trick. Out of curiosity, is there a reason for the first way to be not supported?
-
wrote on 9 Jan 2012, 23:49 last edited by
"using namespace a::b" imports all symbols of a certain namespace.
"using a::b::MyClass" only imports the name MyClass only.
Using gcc, this results in no difference during compilation as it seems, I don't know if that's some relaxed behavior or if it's standards compliant. A true C++ guru should jump in here for some clarification...
1/6