Do not delete qline and qcarc because the scene "owns" them and will delete

This commit is contained in:
Laurent Rineau 2008-10-01 13:10:39 +00:00
parent 4f36fa9cad
commit 9e5cf615dc
1 changed files with 4 additions and 3 deletions

View File

@ -77,8 +77,10 @@ private:
template <typename K>
GraphicsViewCircularArcInput<K>::GraphicsViewCircularArcInput(QObject *parent, QGraphicsScene* s)
: GraphicsViewInput(parent), qline(new QGraphicsLineItem()), qcarc(new CircularArcGraphicsItem<K>()), scene_(s), count(0)
: GraphicsViewInput(parent), scene_(s), count(0)
{
qline = new QGraphicsLineItem();
qcarc = new CircularArcGraphicsItem<K>();
qline->hide();
qcarc->hide();
s->addItem(qline);
@ -89,8 +91,7 @@ GraphicsViewCircularArcInput<K>::GraphicsViewCircularArcInput(QObject *parent, Q
template <typename K>
GraphicsViewCircularArcInput<K>::~GraphicsViewCircularArcInput()
{
delete qline;
delete qcarc;
// do not delete qline and qcarc, because 's' owns them and will delete them.
}