-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathviewer.cpp
More file actions
33 lines (29 loc) · 697 Bytes
/
viewer.cpp
File metadata and controls
33 lines (29 loc) · 697 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
#include <QString>
#include <QFileDialog>
#include <QGraphicsView>
#include "viewer.h"
#include "drawing.h"
#include "ui_viewer.h"
Viewer::Viewer(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::Viewer)
{
ui->setupUi(this);
connect(ui->actionQuitter, SIGNAL(triggered()), this, SLOT(close()));
connect(ui->actionOuvrir, SIGNAL(triggered()), this, SLOT(openGraph()));
}
void Viewer::openGraph()
{
QString filename = QFileDialog::getOpenFileName(this);
if (!filename.isEmpty()) {
Drawing* d = new Drawing(filename);
//_scenes.append(sc);
//ui->docs->setActiveSubWindow(ui->docs->addSubWindow(sc->view()));
setCentralWidget(d);
}
}
Viewer::~Viewer()
{
delete ui;
delete _g;
}