title: How to subclass from QStandardItem?
body: <p>I am getting unexpected errors when deriving from <code>QStandardItem</code>. How I added my derive class is Add New >> C++ Class. Choose base class as <code>QObject</code> and once the class is created I renamed <code>QObject</code>with <code>QStandardItem</code>.</p>
  
  <pre><code>#include &lt;QStandardItem&gt;
  
  class XmlItem : public QStandardItem
  {
      Q_OBJECT
  public:
      //explicit XmlItem(QObject *parent = 0);
      explicit XmlItem(QStandardItem *parent = 0);
  
  signals:
  
  public slots:
  };
  
  XmlItem::XmlItem(QStandardItem *parent) : QStandardItem()
  {
  
  }
  </code></pre>
  
  <p>This gives the following errors (there are more of these)</p>
  
  <pre><code>\debug\moc_XmliIem.cpp:64: error: C2039: 'staticMetaObject' : is not a member of 'QStandardItem'
  \debug\moc_XmliIem.cpp:71: error: C2227: left of '-&gt;metaObject' must point to class/struct/union/generic type
  \debug\moc_XmliIem.cpp:71: error: C2227: left of '-&gt;dynamicMetaObject' must point to class/struct/union/generic type
  </code></pre>
  
  <p>If I comment out <code>Q_OBJECT</code> the errors strangely goes away but obviously I need it because I will have signals and slots.</p>
  
  <p>Why am I getting these errors and how to derive properly from <code>QStandardItem</code>?</p>