right click menu in node view for adding nodes

This commit is contained in:
itsmattkc
2019-04-13 15:57:09 +10:00
parent e20b1d35c2
commit 6bf62017ea
18 changed files with 309 additions and 294 deletions
+5 -2
View File
@@ -29,8 +29,8 @@ NodeUI::NodeUI() :
NodeUI::~NodeUI()
{
if (scene() != nullptr) {
scene()->removeItem(proxy_);
if (proxy_ != nullptr) {
proxy_->setParentItem(nullptr);
}
}
@@ -164,6 +164,7 @@ void NodeUI::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
if (clicked_socket_ > -1) {
bool line_is_touching_node = false;
drag_destination_ = nullptr;
QPointF drag_line_end = event->scenePos();
@@ -234,6 +235,8 @@ void NodeUI::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
if (clicked_socket_ > -1) {
scene()->removeItem(drag_line_);
delete drag_line_;
event->accept();
if (drag_destination_ != nullptr) {