title: Q_OBJECT throwing 'undefined reference to vtable' error
body: <p>I'm using Qt Creator 2.0.1 with Qt 4.7.0 (32 bit) on Windows 7 Ultimate 32 bit.</p>
  
  <p>Consider the following code, which is a minimum to produce the error:</p>
  
  <pre><code>class T : public QObject, public QGraphicsItem
  {
      Q_OBJECT
  
  public:
      T() {}
  
      QRectF      boundingRect() const {return QRectF();}
      void        paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
                        QWidget *widget) {}
  };
  
  int main()
  {
      T t;
      return 0;
  }
  </code></pre>
  
  <p>The above code fragment causes the following linker errors:</p>
  
  <blockquote>
    <p>In function `T':</p>
    
    <p>undefined reference to `vtable for T'</p>
    
    <p>undefined reference to `vtable for T'</p>
    
    <p>In function `~T':</p>
    
    <p>undefined reference to `vtable for T'</p>
    
    <p>undefined reference to `vtable for T'</p>
  </blockquote>
  
  <p>If I comment out the line that contains <code>Q_OBJECT</code>, it compiles fine. I need signal and slots with <code>QGraphicsItem</code> so I need <code>Q_OBJECT</code>.</p>
  
  <p>What is wrong with the code? Thanks.</p>