Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt Creator - Code completion in implementation file

Qt Creator - Code completion in implementation file

Scheduled Pinned Locked Moved Qt Creator and other tools
6 Posts 3 Posters 2.9k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sptrakesh
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Chris H
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sptrakesh
        wrote on last edited by
        #3

        2.4.0 on Mac OS X Snow Leopard with Vim emulation enabled.

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on last edited by
          #4

          You should change your first line to

          @
          using namespace a::b;
          @

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • S Offline
            S Offline
            sptrakesh
            wrote on last edited by
            #5

            Thanks, that does the trick. Out of curiosity, is there a reason for the first way to be not supported?

            1 Reply Last reply
            0
            • G Offline
              G Offline
              goetz
              wrote on last edited by
              #6

              "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...

              http://www.catb.org/~esr/faqs/smart-questions.html

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved