Qt Creator Namespace Issue (Fixed)
-
[quote author="ZapB" date="1301336415"]I would do it with: @ #include "myheader.h" using namespace A; ... D f; @ That works for me here (qt-creator 2.1.0)[/quote]
That worked for me as well, but it has the disadvantage of bring in the entire namespace, something I would rather avoid if possible.
-
[quote author="vinb" date="1301337969"]then i think you can just use A::D f; and not 'using'[/quote]
That of course works. :D But it does address is it a bug in Qt Creator that need to be submitted. :P Bringing in an entire namespace is not everyone's prefered method of writting code.
-
[quote author="vinb" date="1301338717"]I didnt know that your bringing in the whole namespace A when using: A::D [/quote]
Sorry about that I should have been more specific when I said that
@using A::D@ does not breing in the whole namespace.
@using namespace A;@ does bring in the whole namespace. -
thats what i ment. :)
but then i dont understand your folowing post:[quote author="JohnMS" date="1301338178"]
That of course works. :D But it does address is it a bug in Qt Creator that need to be submitted. :P Bringing in an entire namespace is not everyone's prefered method of writting code.
[/quote] -
Wow, I'm loosing my mind. LOL @A::D f@ Should have been @using A::D@ The advantage being that I only bring in the one class that I'm using from that namespace, instead of every class from that namespace. And I can declare a variable @D f@ without needing to specify the namespace.
Note: went back and corrected for future generations. :D -
[quote author="ZapB" date="1301340439"]Try the latest beta of qt-creator 2.2. I understand that this has seen several improvements to the code model that is used by the auto-completer. If it is still broken there then please report it as a bug.[/quote]
Verified that it works in 2.1, as I'm at work, I can't verify the beta build.