Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Autocompletion for template data members within namespaces - what is QtCreator status ?

    General and Desktop
    3
    5
    2732
    Loading More Posts
    • 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.
    • A
      ahoro last edited by

      Can any one share some info where does QtCreator development effort stand on template types autocompletion ?

      we use C++ templates and namespaces extensively, but autocompletion does not seem to work when we combine the two.

      Is there some development (parsing?) effort to make it work?
      Or perhaps there is some optional / 3rd party plugin that would help with this problem?
      Or should I just go ahead and submit a bug?

      simple test case:

      WORKS:

      ====== .h FILE:
      @
      class MyClassData
      {

        bool parameter;
      

      }

      template<class Data>
      class MyBaseClass
      {

      protected:

        Data DATA;
      

      }

      class MyClass : public MyBaseClass<MyClassData>
      {

      void MyMethod();

      }
      @
      ====== .cpp FILE:
      @
      void MyClass::MyMethod()
      {

      DATA.parameter = true; // autocompletion works it is enough to type DATA.p

      }
      @



      does not work:

      ==== .h FILE:
      @
      namespace MyNameSpace
      {

      class MyClassData
      {

        bool parameter;
      

      }

      template<class Data>
      class MyBaseClass
      {

      protected:

        Data DATA;
      

      }

      class MyClass : public MyBaseClass<MyClassData>
      {

      void MyMethod();

      }

      }
      @
      ===== .cpp FILE:
      @
      namespace MyNameSpace
      {

      void MyClass::MyMethod()
      {

      DATA.parameter = true; // autocompletion does not suggest anything for DATA.

      }

      }@

      1 Reply Last reply Reply Quote 0
      • JKSH
        JKSH Moderators last edited by

        Is that with Qt Creator 2.6?

        Search first to see if anyone else has submitted a report (https://bugreports.qt-project.org ). If not, feel free to submit one yourself.

        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

        1 Reply Last reply Reply Quote 0
        • A
          ahoro last edited by

          yes - it seems to behave the same way in 2.5 and 2.6

          in Qt Creator 2.4 it does not work at all (regardless of namespace autocompletion does not recognize tamplated arguments)

          1 Reply Last reply Reply Quote 0
          • T
            tobias.hunger last edited by

            There is work in progress to make the Creator code model use clang for parsing. That does handle the full language, but unfortunately it is rather slow... several times slower than the current engine.

            If you want to take a look: The code is available in the "wip/clang":http://qt.gitorious.org/qt-creator/qt-creator/commits/wip/clang branch. I am not sure about the current state though and as you can see progress is slow. Everybody is currently focusing on getting Qt 5 out;)

            1 Reply Last reply Reply Quote 0
            • A
              ahoro last edited by

              Things I love about QT Creator are speed and lack of bloat.
              I guess I'll stick to internal code model.

              ps. good luck with QT5 - it does look interesting. And if difference in speed for "Hello World!" program is indicative of other parts - than I am sure it is going to be hit!

              1 Reply Last reply Reply Quote 0
              • First post
                Last post