equal
deleted
inserted
replaced
6 QMainWindow(parent), |
6 QMainWindow(parent), |
7 ui(new Ui::MainWindow) |
7 ui(new Ui::MainWindow) |
8 { |
8 { |
9 ui->setupUi(this); |
9 ui->setupUi(this); |
10 |
10 |
11 DrawMapScene * scene = new DrawMapScene(this); |
11 scene = new DrawMapScene(this); |
12 ui->graphicsView->setScene(scene); |
12 ui->graphicsView->setScene(scene); |
13 |
13 |
14 connect(ui->pbUndo, SIGNAL(clicked()), scene, SLOT(undo())); |
14 connect(ui->pbUndo, SIGNAL(clicked()), scene, SLOT(undo())); |
|
15 connect(scene, SIGNAL(pathChanged()), this, SLOT(scene_pathChanged())); |
15 } |
16 } |
16 |
17 |
17 MainWindow::~MainWindow() |
18 MainWindow::~MainWindow() |
18 { |
19 { |
19 delete ui; |
20 delete ui; |
36 Q_UNUSED(event); |
37 Q_UNUSED(event); |
37 |
38 |
38 if(ui->graphicsView) |
39 if(ui->graphicsView) |
39 ui->graphicsView->fitInView(ui->graphicsView->scene()->sceneRect(), Qt::KeepAspectRatio); |
40 ui->graphicsView->fitInView(ui->graphicsView->scene()->sceneRect(), Qt::KeepAspectRatio); |
40 } |
41 } |
|
42 |
|
43 void MainWindow::scene_pathChanged() |
|
44 { |
|
45 ui->plainTextEdit->setPlainText(scene->encode().toBase64()); |
|
46 } |