SCgCommandCreateNode::SCgCommandCreateNode(SCgScene *scene, const QPointF &point, SCgContour *parentContour, QUndoCommand *parent) : SCgBaseCommand(scene, 0, parent), mPoint(point), mParentContour(parentContour) { mObject = mScene->createSCgNode(mPoint); connect(mObject, SIGNAL(destroyed()), this, SLOT(nodeDestroyed())); setText(QObject::tr("Create node")); }
/*! \internal */ QNode::~QNode() { Q_D(QNode); // Disconnect each connection that was stored for (auto it = d->m_destructionConnections.begin(), end = d->m_destructionConnections.end(); it != end; ++it) QObject::disconnect(it.value()); d->m_destructionConnections.clear(); Q_EMIT nodeDestroyed(); // Notify the backend that the parent lost this node as a child and // that this node is being destroyed. d->notifyDestructionChangesAndRemoveFromScene(); }