How to enable C++11 in Qt Creator ?
The best solution :
CONFIG += c++11
Add the .pro file (see at the bottom of that web page). It requires Qt 5.
The following answer is:
QMAKE_CXXFLAGS += -std=c++11 (or QMAKE_CXXFLAGS += -std=c++0x)
Its work with Qt 4.8 and gcc / clang.
Set this .pro file
QMAKE_CXXFLAGS += -std=c++11
or
CONFIG += c++11
Alternative for handling both cases,
# With C++11 support greaterThan(QT_MAJOR_VERSION, 4){ CONFIG += c++11 } else { QMAKE_CXXFLAGS += -std=c++0x }
The project files can be handle which Qt version if people using in the team, but want them to have C++11 enabled in any case.