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



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

    }

    }@


  • Moderators

    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.



  • 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)


  • Moderators

    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;)



  • 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!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.