|
|
|
@ -192,6 +192,15 @@ void GraphWidget::keyPressEvent(QKeyEvent *e)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case Qt::Key_Space: {
|
|
|
|
|
modifyRoute();
|
|
|
|
|
}
|
|
|
|
|
default:
|
|
|
|
|
QGraphicsView::keyPressEvent(e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GraphWidget::modifyRoute()
|
|
|
|
|
{
|
|
|
|
|
for (QList<Edge*>::iterator it = m_route.begin(); it != m_route.end(); ++it)
|
|
|
|
|
(*it)->setIsRoute(false);
|
|
|
|
|
|
|
|
|
@ -215,10 +224,7 @@ void GraphWidget::keyPressEvent(QKeyEvent *e)
|
|
|
|
|
(*it)->setIsRoute(true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
default:
|
|
|
|
|
QGraphicsView::keyPressEvent(e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void GraphWidget::removeEdge(Node* selectedNode, Node* nodeUnderMouse)
|
|
|
|
|
{
|
|
|
|
|