I'm trying to use C++14 (or C++11) in a small Qt4 application. I have, for example,

Qt Code:
  1. auto layout = new QHBoxLayout;
To copy to clipboard, switch view to plain text mode 

instead of the usual

Qt Code:
  1. QHBoxLayout *layout = new QHBoxLayout;
To copy to clipboard, switch view to plain text mode 

Compiling with g++ (Arch Linux, upgraded about a month ago) gives errors (copied by hand; copy/paste not working with my xterm today):

Qt Code:
  1. x.cpp:31:2: warning: 'auto' changes meaning in C++11; please remove it
  2. auto layout = new QHBoxLayout;
  3. ^
  4.  
  5. x.cpp:31:7: error: 'layout' does not name a type
  6. auto layout = new QHBoxLayout;
  7. ^
To copy to clipboard, switch view to plain text mode 

Perhaps there's something wrong with the way I wrote the line with 'auto', or perhaps Qt4 isn't compatible with using C++11. I did find documentation for qmake (I'm actually using qmake-qt4) and the CONFIG variable, so I put this into the .pro file:

Qt Code:
  1. CONFIG += c++11
To copy to clipboard, switch view to plain text mode 
Is there more I need to do? Am I a fool to try using C++11 or C++14?

Does Qt5 deal with C++11 the same way as Qt4?