Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Autocompletion for template data members within namespaces - what is QtCreator status ?
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 3.1k Views 1 Watching
  • 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 Offline
    A Offline
    ahoro
    wrote on last edited by
    #1

    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
    0
    • JKSHJ Online
      JKSHJ Online
      JKSH
      Moderators
      wrote on last edited by
      #2

      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
      0
      • A Offline
        A Offline
        ahoro
        wrote on last edited by
        #3

        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
        0
        • T Offline
          T Offline
          tobias.hunger
          wrote on last edited by
          #4

          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
          0
          • A Offline
            A Offline
            ahoro
            wrote on last edited by
            #5

            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
            0

            • Login

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