Important: Please read the Qt Code of Conduct -

Is auto completion support for smart pointers and vector objects planned?

  • I am trying to use Qt Creator as my main IDE for everything but this is something that keeps stepping on my toes. Is there any planned support for auto completion when using vector ( maybe all stl containers ) and smart pointers?

    Also the syntax highlighting doesn't work on these as well.

  • Is there a way to get this working? Or do these features just not exist?

  • Moderators


    What is your OS?

    What version of Qt Creator are you running?

    What Qt kit is your project using?

    It works for me. I have Qt Creator 2.8.1 on Windows 7 32-bit. My kit is Qt 5.1.1 for MSVC 2010 32-bit with ANGLE.

    When I type "std::" I am offered a list of standard stuff (abort, abs, acos...).

    After I declare "std::vector<int> vec;" when I type "vec.", I am offered a list of types and functions for std::vector (allocator_type, assign, at...)

    Syntax highlighting works fine for me too.

  • Fedora KDE 64bit
    Latest Qt SDK 5.1.1 QtCreator 2.8.1
    GNU g++


    class MyClass

       void SomeFunc();

    //... other stuff

    std::vector< MyClass > vec;

    vec[0].SomeFunc(); // auto completion will not show up here and syntax highlighting won't either ( maybe just if its unique_ptr inside the vector, can't remember atm )


    unique_ptr< MyClass > pMyClass( new MyClass() );

    pMyClass->SomeFunc(); // auto completion and syntax highlighting doesn't work here either.

  • Moderators

    You're right, it doesn't work for me either.

    I think the issue is related to having multiple layers of typedefs and typenames within the standard template (at least that's how MSVC's vector template was implemented; not sure about g++). Qt Creator seems to stop following them after a few layers. In contrast, the QVector header is much cleaner and doesn't have so many layers:

    Feel free to file a bug report at -- I'm sure many others are interested in this functionality too.

Log in to reply