title: QObject retunrs with exception even after the copy constructor being declared
body: <p>I am trying to write a sample code for qt script. I thought I am doing the right thing when I declare the <code>QObjecy</code> with the copy construtor and I also took the liberty to declare the <code>=</code> operator. But this code keeps giving me the </p>
  
  <pre><code>'QObject::QObject' : cannot access private member declared in class 'QObject'
  </code></pre>
  
  <p>Error. </p>
  
  <p>I am declaring a <code>MyClass</code> which is a <code>QObject</code> as follows. I am aware of the fact that this can some one see what I am doing a wroing here.</p>
  
  <p>The header:</p>
  
  <pre><code>#ifndef SCRIPT_CLASSES_H
  #define SCRIPT_CLASSES_H
  #include "QObject"
  #include "QtScript/QScriptValue"
  #include "QtScript/QScriptable"
  #include "QtScript/QScriptClass"
  
  class MyClass : public QObject
  {
      Q_OBJECT
  //    Q_PROPERTY( int _id WRITE setId READ id )
  public :
      MyClass(QObject *aparent =0) ;
      ~MyClass();
  
  //     bool operator =(MyClass obj);
  
  public slots:
      void setId(int d);
      int id() const ;
  //    bool MyClass::equals(const MyClass &amp;other);
  private :
      int _id;
  };
  
  class QScriptEngine;
  class Script_Classes : public QObject, public QScriptClass
  {
  public:
      Script_Classes(QScriptEngine *engine);
      ~Script_Classes();
  private :
      static QScriptValue myClassToScript(QScriptEngine *engine,const MyClass &amp;in);
      static void myClassFromScript(const QScriptValue &amp;object, MyClass &amp;out);
  };
  
  #endif // SCRIPT_CLASSES_H
  </code></pre>
  
  <p>And my source class is as follows:</p>
  
  <pre><code>#include "script_classes.h"
  #include "QMetaType"
  #include "QtScript/QScriptEngine"
  #include "QtScript/QScriptValue"
  
  Q_DECLARE_METATYPE(MyClass)
  Q_DECLARE_METATYPE(MyClass*)
  
  MyClass::MyClass(QObject *aparent) : QObject (aparent){}
  
  MyClass::~MyClass(){}
  
  void MyClass::setId(int d){
      _id = d;
  }
  
  
  int MyClass::id() const{
     return _id;
  }
  
  bool MyClass::equals(const MyClass &amp;other)
  {
      return id() == other.id();
  }
  
  bool MyClass::operator =(MyClass obj){
      return id()==obj.id();
  }
  
  
  
  Script_Classes::Script_Classes(QScriptEngine *engine):QObject(engine),QScriptClass(engine)
  {
      qScriptRegisterMetaType&lt;MyClass&gt;(engine, myClassToScript, myClassFromScript);
      MyClass testClass(this);
  }
  
  void Script_Classes::myClassFromScript(const QScriptValue &amp;object, MyClass &amp;out){
  out.setId(object.property("id").toInt32());
  }
  
  QScriptValue Script_Classes::myClassToScript(QScriptEngine *engine, const  MyClass &amp;in)    
  {
      QScriptValue value = engine-&gt;newObject();
      value.setProperty("id", in.id());
      return value;
  }
  </code></pre>