SasaVilic
6th November 2010, 00:33
I am writing my class that uses QPointF. I want to use implicit sharing:
class GeometryLineItemData : public QSharedData {
public:
GeometryLineItemData();
GeometryLineItemData(const GeometryLineItemData &other);
~GeometryLineItemData();
QPointF p1;
QPointF p2;
};
My question is: Is it safe to use one class that uses implicit sharing in another implicitly shared class? Should I in copy constructor explicitly initialize points, or leave that like it is QT documentary written (although I think they were talking only about simple types)
class GeometryLineItemData : public QSharedData {
public:
GeometryLineItemData();
GeometryLineItemData(const GeometryLineItemData &other);
~GeometryLineItemData();
QPointF p1;
QPointF p2;
};
My question is: Is it safe to use one class that uses implicit sharing in another implicitly shared class? Should I in copy constructor explicitly initialize points, or leave that like it is QT documentary written (although I think they were talking only about simple types)