title: How to trick QtCreator about the existence of a macro definition
body: <p>QtCreator has some problems with the code model when using some of the fancy C++11 features in a C++/Qt project. In my case: templated alias, as the following:</p>
  
  <pre><code>template&lt;class T&gt; using Ptr = QSharedPointer&lt;T&gt;;
  
  QSharedPointer&lt;SomeClass&gt; myPtr = ...;
  myPtr-&gt;...                               // will complete
  
  Ptr&lt;SomeClass&gt; myPtr = ...;              // not even parsed as a type...
  myPtr-&gt;...                               // won't complete
  </code></pre>
  
  <p>So I thought about just macro-hacking my <code>Ptr</code> definition <em>when QtCreator parses the file</em>, but of course use the nice templated alias syntax <em>when the compiler parses the file</em>. Something like:</p>
  
  <pre><code>#ifdef QT_CREATOR
  # define Ptr QSharedPointer
  #else
  template&lt;class T&gt; using Ptr = QSharedPointer&lt;T&gt;;
  #endif
  </code></pre>
  
  <p>Putting a macro definition in the .pro file using a <code>DEFINES += -D...</code> won't work, as QtCreator is smart enough to use them in the code model (which is nice, of course). Also, <code>QMAKE_CXXFLAGS += -D...</code> is being parsed correctly (sadly).</p>
  
  <p>How can I "trick" QtCreator that there is a macro defined, but (for the compiler) there isn't (or the other way around)?</p>
  
  <p>PS: I'm using the most recent version (2.7), and also tried 2.6.</p>