[Qt-creator] Problems using c++11 features

Prof. Dr.-Ing. Wilhelm Meier wilhelm.meier at fh-kl.de
Tue Apr 2 11:49:10 CEST 2013


Hi all,

in the following simple example (code and project settings below) using 
c++11-features I heavily miss the autocompletion: the templates of 
<memory> aren't autocompleted as well as the members of the 
std::shared_ptr template and the pointed-to object.

I'm using qtcreator-2.7 and gcc-4.8.0.

Is there any chance to get this working?

---------------

#include <memory>
#include <string>

class X
{
public:
     inline std::string name() {
         return mName;
     }
private:
     std::string mName;
};

int main()
{
     // no completion for std::make_shared
     auto p1 = std::make_shared<X>();
     // no completion for member-function
     p1->name();

     // no completion for std::shared_ptr
     std::shared_ptr<X> p2 = std::make_shared<X>();
     // no completion for member-function
     p2->name();
}

----------------------

QT       += core
QT       -= gui

TARGET = l0002
CONFIG   += console
CONFIG   -= app_bundle

TEMPLATE = app

QMAKE_CXXFLAGS += -Wall -Wextra -std=c++11

SOURCES += main.cc

-- 
Wilhelm




More information about the Qt-creator mailing list