Showing
4 changed files
with
26 additions
and
0 deletions
... | @@ -48,6 +48,10 @@ void MainWindow::createActions() | ... | @@ -48,6 +48,10 @@ void MainWindow::createActions() |
48 | resetColorAct = new QAction(tr("Reset colors"), this); | 48 | resetColorAct = new QAction(tr("Reset colors"), this); |
49 | resetColorAct->setStatusTip(tr("Reset all node's color")); | 49 | resetColorAct->setStatusTip(tr("Reset all node's color")); |
50 | connect(resetColorAct, &QAction::triggered, this, &MainWindow::reset_color); | 50 | connect(resetColorAct, &QAction::triggered, this, &MainWindow::reset_color); |
51 | + | ||
52 | + testAct = new QAction(tr("test action"), this); | ||
53 | + testAct->setStatusTip(tr("test test")); | ||
54 | + connect(testAct, &QAction::triggered, this, &MainWindow::test); | ||
51 | } | 55 | } |
52 | 56 | ||
53 | void MainWindow::createMenus() | 57 | void MainWindow::createMenus() |
... | @@ -59,6 +63,9 @@ void MainWindow::createMenus() | ... | @@ -59,6 +63,9 @@ void MainWindow::createMenus() |
59 | actionMenu->addAction(mightKnowAct); | 63 | actionMenu->addAction(mightKnowAct); |
60 | actionMenu->addAction(topkAct); | 64 | actionMenu->addAction(topkAct); |
61 | actionMenu->addAction(resetColorAct); | 65 | actionMenu->addAction(resetColorAct); |
66 | + | ||
67 | + testMenu = menuBar()->addMenu(tr("&Test")); | ||
68 | + testMenu->addAction(testAct); | ||
62 | } | 69 | } |
63 | 70 | ||
64 | ////////////////////////////////////////////////////////////////// | 71 | ////////////////////////////////////////////////////////////////// |
... | @@ -84,3 +91,8 @@ void MainWindow::reset_color() | ... | @@ -84,3 +91,8 @@ void MainWindow::reset_color() |
84 | { | 91 | { |
85 | graphWidget->reset_color(); | 92 | graphWidget->reset_color(); |
86 | } | 93 | } |
94 | + | ||
95 | +void MainWindow::test() | ||
96 | +{ | ||
97 | + graphWidget->test(); | ||
98 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -24,6 +24,10 @@ private: | ... | @@ -24,6 +24,10 @@ private: |
24 | QAction *mightKnowAct; | 24 | QAction *mightKnowAct; |
25 | QAction *topkAct; | 25 | QAction *topkAct; |
26 | QAction *resetColorAct; | 26 | QAction *resetColorAct; |
27 | + | ||
28 | + //test | ||
29 | + QMenu *testMenu; | ||
30 | + QAction *testAct; | ||
27 | 31 | ||
28 | private: | 32 | private: |
29 | void createActions(); | 33 | void createActions(); |
... | @@ -34,6 +38,8 @@ private slots: | ... | @@ -34,6 +38,8 @@ private slots: |
34 | void might_know(); | 38 | void might_know(); |
35 | void topk(); | 39 | void topk(); |
36 | void reset_color(); | 40 | void reset_color(); |
41 | + //test | ||
42 | + void test(); | ||
37 | }; | 43 | }; |
38 | 44 | ||
39 | #endif // MAINWINDOW_H | 45 | #endif // MAINWINDOW_H | ... | ... |
... | @@ -60,6 +60,11 @@ void PaperGraphWidget::reset_color() | ... | @@ -60,6 +60,11 @@ void PaperGraphWidget::reset_color() |
60 | scene->update(); | 60 | scene->update(); |
61 | } | 61 | } |
62 | 62 | ||
63 | +void PaperGraphWidget::test() | ||
64 | +{ | ||
65 | + //test | ||
66 | +} | ||
67 | + | ||
63 | void PaperGraphWidget::handleSelectionChanged(int idx) | 68 | void PaperGraphWidget::handleSelectionChanged(int idx) |
64 | { | 69 | { |
65 | QMessageBox::information(this, "QCombobox", | 70 | QMessageBox::information(this, "QCombobox", | ... | ... |
... | @@ -19,6 +19,9 @@ public: | ... | @@ -19,6 +19,9 @@ public: |
19 | void topk(); | 19 | void topk(); |
20 | void reset_color(); | 20 | void reset_color(); |
21 | 21 | ||
22 | + //test | ||
23 | + void test(); | ||
24 | + | ||
22 | private slots: | 25 | private slots: |
23 | void handleSelectionChanged(int idx); | 26 | void handleSelectionChanged(int idx); |
24 | 27 | ... | ... |
-
Please register or login to post a comment