Code: Alles auswählen
class Geometry : public QObject
{
Q_OBJECT
public:
Geometry(QString name = QString());
...
}
Code: Alles auswählen
/usr/include/QtCore/qobject.h:287: error: 'QObject::QObject(const QObject&)' is private
src/geometry.h:31: error: within this context
src/point.h: In copy constructor 'Point::Point(const Point&)':
src/point.h:31: note: synthesized method 'Geometry::Geometry(const Geometry&)' first required here
/usr/include/QtCore/qlist.h: In member function 'void QList<T>::append(const T&) [with T = Point]':
/usr/include/QtCore/qlist.h:419: note: synthesized method 'Point::Point(const Point&)' first required here
/usr/include/QtCore/qobject.h: In member function 'Geometry& Geometry::operator=(const Geometry&)':
src/geometry.h:31: instantiated from 'void QList<T>::node_construct(QList<T>::Node*, const T&) [with T = Point]'
/usr/include/QtCore/qlist.h:417: instantiated from 'void QList<T>::append(const T&) [with T = Point]'
src/linestring.cpp:68: instantiated from here
/usr/include/QtCore/qobject.h:287: error: 'QObject& QObject::operator=(const QObject&)' is private
src/geometry.h:31: error: within this context
src/point.h: In member function 'Point& Point::operator=(const Point&)':
src/point.h:31: note: synthesized method 'Geometry& Geometry::operator=(const Geometry&)' first required here
/usr/include/QtCore/qlist.h: In member function 'void QList<T>::node_construct(QList<T>::Node*, const T&) [with T = Point]':
/usr/include/QtCore/qlist.h:332: note: synthesized method 'Point& Point::operator=(const Point&)' first required here
gmake: *** [linestring.o] Error 1
*** Exited with status: 2 ***
Dies war mit bisher nie so bewußt, denn die komplette Objekthierarchie von Qt hat ja dann das selbe Problem... Oben steht QObjekt, dann bspw. QFrame -> QAbstractScrollArea -> QTextEdit
Sind Pointer somit die Lösung, oder gibt es eine bessere Möglichkeit, bei der ich dann auch Kopien von den Child-Objekten erstellen kann.