From a3f87785f5bec1d7a8b7d5f460fb09a78dabc4ca Mon Sep 17 00:00:00 2001 From: Denes Matetelki Date: Tue, 14 Jun 2011 11:45:41 +0200 Subject: [PATCH] last node cannot be deleted --- graphwidget.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/graphwidget.cpp b/graphwidget.cpp index cec0084..3f06f5d 100644 --- a/graphwidget.cpp +++ b/graphwidget.cpp @@ -331,6 +331,14 @@ void GraphWidget::keyPressEvent(QKeyEvent *event) if (m_activeNode) { + if (m_nodeList.size()==1) + { + dynamic_cast(m_parent)->getStatusBar()->showMessage( + tr("Last node cannot be deleted."), + 5000); // millisec + break; + } + if (m_hintNode==m_activeNode) m_hintNode=0;