Hi,
here the related stuff of my virtual base class:
{
Q_OBJECT
public:
virtual QRectF boundingRect
() const = 0;
signals:
//...
}
{
}
class TextItemAbstract : public QObject, public QGraphicsItem
{
Q_OBJECT
public:
TextItemAbstract(QGraphicsItem *_parent = 0);
virtual QRectF boundingRect() const = 0;
virtual void paint(QPainter *_painter, const QStyleOptionGraphicsItem *_option, QWidget *_widget) = 0;
signals:
//...
}
TextItemAbstract::TextItemAbstract( QGraphicsItem *_parent ) :
QObject(), QGraphicsItem( _parent )
{
}
To copy to clipboard, switch view to plain text mode
So even if I give QObject no parent after destroying TextItemAbstract the QObject does cleanup, or must I call ~QObject() explicit?
Thanks,
Lykurg
Bookmarks