How to configure QtCreator to work with C ++ 11?

I wrote some project using QtCreator 2.5.1 and Qt 4.8.0. I added to the * .pro file:

QMAKE_CXXFLAGS += -std=c++0x

And everything compiles and works correctly, but the IDE still highlights C ++ 11-style code fragments as incorrect. For instance. this line:

QVector<int> colwi{100,70,30,40,25,25,25,25,25};

Can this be fixed?

+5
source share
2 answers

in the qmake.pro file, add

Qt5:

CONFIG += c++11

or Qt4:

CXXFLAGS += -std=c++11

See http://qt-project.org/forums/viewthread/24551

+1
source

Partially upgraded to Qt Creator 2.6. It better supports C ++ 11 functions, but still not complete. Looking around the creator, there is a good company: I have not seen a compiler that covers all the new functions :-)

, Creator CXXFLAGS . -std = ++ 0x out, ++ 11.

-1

All Articles