'No active node' message is printed to statusbar upon attempt to delete when there is no active node

master
Denes Matetelki 14 years ago
parent 080c5aac6a
commit 4233f7e00d

3
.gitignore vendored

@ -1 +1,4 @@
*.qm *.qm
*.o
Makefile
ui_*

@ -1,13 +1,17 @@
#include "graphwidget.h" #include "graphwidget.h"
#include <QDebug> #include <QDebug>
#include "node.h" #include <QStatusBar>
//#include <QGraphicsTextItem>
#include "node.h"
#include "edge.h" #include "edge.h"
#include "math.h" #include "math.h"
#include "mainwindow.h"
GraphWidget::GraphWidget(QWidget *parent) : GraphWidget::GraphWidget(QWidget *parent) :
QGraphicsView(parent), QGraphicsView(parent),
m_parent(parent),
m_activeNode(0), m_activeNode(0),
m_showingNodeNumbers(false), m_showingNodeNumbers(false),
m_followNode(0) m_followNode(0)
@ -237,6 +241,12 @@ void GraphWidget::keyPressEvent(QKeyEvent *event)
showingAllNodeNumbers(false); showingAllNodeNumbers(false);
} }
} }
else
{
dynamic_cast<MainWindow *>(m_parent)->getStatusBar()->showMessage(
tr("No active node "),
5000); // millisec
}
break; break;

@ -34,6 +34,7 @@ private:
bool numberStartsWithNumber(const int &number, const int &prefix); bool numberStartsWithNumber(const int &number, const int &prefix);
QList<Node *> m_nodeList; QList<Node *> m_nodeList;
QWidget *m_parent;
Node *m_activeNode; Node *m_activeNode;
QGraphicsScene *m_scene; QGraphicsScene *m_scene;
bool m_showingNodeNumbers; bool m_showingNodeNumbers;

@ -47,7 +47,7 @@ MainWindow::MainWindow(QWidget *parent) :
connect(m_ui->actionAbout_QtMindMap, SIGNAL(activated()), this, connect(m_ui->actionAbout_QtMindMap, SIGNAL(activated()), this,
SLOT(about())); SLOT(about()));
m_graphicsView = new GraphWidget(m_ui->centralWidget); m_graphicsView = new GraphWidget(this);
setCentralWidget(m_graphicsView); setCentralWidget(m_graphicsView);
} }
@ -120,3 +120,8 @@ void MainWindow::aboutDestroyed()
setEnabled(true); setEnabled(true);
} }
QStatusBar * MainWindow::getStatusBar()
{
return m_ui->statusBar;
}

@ -18,6 +18,7 @@ class MainWindow : public QMainWindow
public: public:
explicit MainWindow(QWidget *parent = 0); explicit MainWindow(QWidget *parent = 0);
~MainWindow(); ~MainWindow();
QStatusBar * getStatusBar();
public slots: public slots:
void klakk(); void klakk();

Loading…
Cancel
Save