MainWindow.cpp
961 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include "stdafx.h"
#include "MainWindow.h"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
//ui.setupUi(this);
graphWidget = new PaperGraphWidget;
setCentralWidget(graphWidget);
/*QVBoxLayout *layout = new QVBoxLayout;
layout->setMargin(5);
graphWidget->setLayout(layout);*/
//create menu
testAct = new QAction(tr("&Test"), this);
testAct->setStatusTip(tr("Test Action"));
connect(testAct, &QAction::triggered, this, &MainWindow::test_func);
fileMenu = menuBar()->addMenu(tr("&File"));
fileMenu->addAction(testAct);
QString message = tr("test message");
statusBar()->showMessage(message);
setMinimumSize(160, 160);
resize(800, 600);
}
MainWindow::~MainWindow()
{
}
void MainWindow::print_graph(std::ifstream& fin)
{
graphWidget->print_graph(fin);
}
void MainWindow::test_func()
{
/*QMessageBox::information(this, "test",
"test: "+QString::number(11));*/
graphWidget->path_highlight();
//graphWidget->update();
}