title: Find root cause of "cannot access private member declared in class 'QObject'"
body: <p>I understand why I get a <code>C2248: 'QObject::QObject' : cannot access private member declared in class 'QObject'</code> . Qt objects are not copyable, as explained here:</p>
  
  <ol>
  <li><a href="https://stackoverflow.com/a/3513395/356726">https://stackoverflow.com/a/3513395/356726</a></li>
  <li><a href="http://qt-project.org/doc/qt-5.0/qtcore/qobject.html#no-copy-constructor-or-assignment-operator" rel="nofollow noreferrer">No copy constructor or assignment operator</a></li>
  </ol>
  
  <p>The <strong>problem</strong> is, that the compiler message always indicates the last line (closing <code>}</code>) of the class:</p>
  
  <pre><code>class MyQObject : public QObject {
         Q_OBJECT
         ....
  }; &lt;-- error line
  </code></pre>
  
  <p>Root cause is somewhere else, ie. where the class is copied (other file, some different line in code). This is sometimes hard to spot!
  <strong>Question</strong>: Is there a way to locate the line of the real reason for the error</p>
  
  <p><em>Remark</em>: Please note, before you mark this Duplicate. Question is about finding the root cause, not how to solve it as in the other questions.</p>
  
  <p>--- Edit 1 ---</p>
  
  <p>Good hint Kuba et.al. It's VS2010, compiling in Qt Creator 2.8.0</p>
  
  <pre><code>'QObject::QObject'
          C:\Qt\5.1.0-32\qtbase\include\QtCore/qobject.h(115) : see declaration of 'QObject'
          This diagnostic occurred in the compiler generated function 'MyQObject ::MyQObject (const MyQObject &amp;)'
  </code></pre>
  
  <p>I wonder why a copy constructor is generated. One idea crossed my mind, I am using the DBus enabled version of Qt, might this be the reason?</p>