diff --git a/.gitignore b/.gitignore index 8df47d5..041ce7d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ *.qm +*.o +Makefile +ui_* diff --git a/graphwidget.cpp b/graphwidget.cpp index ca3fdc3..d1d2dcf 100644 --- a/graphwidget.cpp +++ b/graphwidget.cpp @@ -1,13 +1,17 @@ #include "graphwidget.h" + #include -#include "node.h" +#include + -//#include +#include "node.h" #include "edge.h" #include "math.h" +#include "mainwindow.h" GraphWidget::GraphWidget(QWidget *parent) : QGraphicsView(parent), + m_parent(parent), m_activeNode(0), m_showingNodeNumbers(false), m_followNode(0) @@ -237,6 +241,12 @@ void GraphWidget::keyPressEvent(QKeyEvent *event) showingAllNodeNumbers(false); } } + else + { + dynamic_cast(m_parent)->getStatusBar()->showMessage( + tr("No active node "), + 5000); // millisec + } break; diff --git a/graphwidget.h b/graphwidget.h index b420aed..261ed3a 100644 --- a/graphwidget.h +++ b/graphwidget.h @@ -34,6 +34,7 @@ private: bool numberStartsWithNumber(const int &number, const int &prefix); QList m_nodeList; + QWidget *m_parent; Node *m_activeNode; QGraphicsScene *m_scene; bool m_showingNodeNumbers; diff --git a/mainwindow.cpp b/mainwindow.cpp index 5140074..45a29c3 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -47,7 +47,7 @@ MainWindow::MainWindow(QWidget *parent) : connect(m_ui->actionAbout_QtMindMap, SIGNAL(activated()), this, SLOT(about())); - m_graphicsView = new GraphWidget(m_ui->centralWidget); + m_graphicsView = new GraphWidget(this); setCentralWidget(m_graphicsView); } @@ -120,3 +120,8 @@ void MainWindow::aboutDestroyed() setEnabled(true); } + +QStatusBar * MainWindow::getStatusBar() +{ + return m_ui->statusBar; +} diff --git a/mainwindow.h b/mainwindow.h index 483bf36..cd54171 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -18,6 +18,7 @@ class MainWindow : public QMainWindow public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); + QStatusBar * getStatusBar(); public slots: void klakk();