title: Qt moc_ include file problem
body: <p>I'm trying to compile the basic tutorial program at <a href="http://doc.trolltech.com/4.4/mainwindows-application.html" rel="nofollow noreferrer">http://doc.trolltech.com/4.4/mainwindows-application.html</a> and running into a problem.</p>
  
  <p>Doing things the way the tutorial program does them, gives a compile error:</p>
  
  <pre><code>In file included from debug\moc_mainwindow.cpp:10:
  debug\../mainwindow.h:2: error: expected class-name before '{' token
  debug\../mainwindow.h:5: error: ISO C++ forbids declaration of `Q_OBJECT' with no type
  </code></pre>
  
  <p>The problem is the need for</p>
  
  <pre><code>#include &lt;QtGui&gt;
  </code></pre>
  
  <p>The tutorial program puts this in mainwindow.cpp which is the desirable way to do it, but then it doesn't get copied into the moc file.</p>
  
  <p>If I put it into mainwindow.h instead, everything works fine, but doing that in every header file is inelegant and will extend compile times once the program gets large.</p>
  
  <p>Is this something that changed since the tutorial was written? (I'm using the latest Qt 4.5.3, Windows SDK install, compiling from the command line.) Am I missing something, or is there any known fix for this problem?</p>