-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmainwindow.cpp
More file actions
42 lines (34 loc) · 1.13 KB
/
mainwindow.cpp
File metadata and controls
42 lines (34 loc) · 1.13 KB
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
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <vector>
#include <QDebug>
#include <QGraphicsView>
#include "princompscene.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
setWindowTitle(trUtf8("Метод главных компонент для 2D точек"));
// Область рисования
m_view = new QGraphicsView;
m_view->setRenderHint(QPainter::Antialiasing, true);
setCentralWidget(m_view);
m_scene = new pca::PrincompScene;
m_view->setScene(m_scene);
m_view->show();
// Действия
m_clearScreenAct = new QAction(trUtf8("&Очистить сцену"), this);
m_clearScreenAct->setShortcut(tr("Ctrl+L"));
connect(m_clearScreenAct, SIGNAL(triggered()), m_scene, SLOT(clearScene()));
// Меню
m_optionMenu = new QMenu(trUtf8("&Опции"), this);
m_optionMenu->addAction(m_clearScreenAct);
menuBar()->addMenu(m_optionMenu);
// Обработчики
//connect(ui->btnClear, SIGNAL(clicked()), m_scene, SLOT(clear()));
}
MainWindow::~MainWindow()
{
delete ui;
}