I have a problem with my object hierarchy. I have child classes "Point", "LineString", ... which inherits the parent class "Geometry".
Now I want to emit signals from the child objects, so I added QObject to the parent class
Qt Code:
  1. class Geometry : public QObject
  2. {
  3. Q_OBJECT
  4. public:
  5. Geometry(QString name = QString());
  6. ...
  7. }
To copy to clipboard, switch view to plain text mode 

On compiling I get the following error:

Qt Code:
  1. /usr/include/QtCore/qobject.h:287: error: 'QObject::QObject(const QObject&)' is private
  2. src/geometry.h:31: error: within this context
  3. src/point.h: In copy constructor 'Point::Point(const Point&)':
  4. src/point.h:31: note: synthesized method 'Geometry::Geometry(const Geometry&)' first required here
  5. /usr/include/QtCore/qlist.h: In member function 'void QList<T>::append(const T&) [with T = Point]':
  6. /usr/include/QtCore/qlist.h:419: note: synthesized method 'Point::Point(const Point&)' first required here
  7. /usr/include/QtCore/qobject.h: In member function 'Geometry& Geometry::operator=(const Geometry&)':
  8. src/geometry.h:31: instantiated from 'void QList<T>::node_construct(QList<T>::Node*, const T&) [with T = Point]'
  9. /usr/include/QtCore/qlist.h:417: instantiated from 'void QList<T>::append(const T&) [with T = Point]'
  10. src/linestring.cpp:68: instantiated from here
  11. /usr/include/QtCore/qobject.h:287: error: 'QObject& QObject::operator=(const QObject&)' is private
  12. src/geometry.h:31: error: within this context
  13. src/point.h: In member function 'Point& Point::operator=(const Point&)':
  14. src/point.h:31: note: synthesized method 'Geometry& Geometry::operator=(const Geometry&)' first required here
  15. /usr/include/QtCore/qlist.h: In member function 'void QList<T>::node_construct(QList<T>::Node*, const T&) [with T = Point]':
  16. /usr/include/QtCore/qlist.h:332: note: synthesized method 'Point& Point::operator=(const Point&)' first required here
  17. gmake: *** [linestring.o] Error 1
  18. *** Exited with status: 2 ***
To copy to clipboard, switch view to plain text mode 
I've read, that the copy constructor of QObject is private though it's not possible to make copies from derived objects.
But the whole Qt object hierarchy does it the same QObject -> QFrame -> QAbstractScrollArea -> QTextEdit
Why does this work? Where is the problem with my code?