-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainwindow.cpp
More file actions
46 lines (38 loc) · 1.41 KB
/
mainwindow.cpp
File metadata and controls
46 lines (38 loc) · 1.41 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
43
44
45
46
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "formrespect.h"
#include "librespect.h"
#include "wavefile.h"
#include <QFileDialog>
#include <QMessageBox>
#include <QSettings>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
ploter = ui->widget;
QSettings settings("respect");
ploter->setColorMin(settings.value("colorMin","#000000").toString());
ploter->setColorMax(settings.value("colorMax","#52FFFF").toString());
ploter->setColorOverflow(settings.value("colorOverflow","#DDCC47").toString());
connect(ploter->view(), SIGNAL(selectedItemChanged(QString)),
ui->plainTextEdit, SLOT(setPlainText(QString)));
connect(ploter->view(), SIGNAL(selectedItemChanged(QString)),
ui->plainTextEdit, SLOT(setPlainText(QString)));
connect(ui->plainTextEdit, SIGNAL(textChanged()),
ploter->view(), SLOT(selectedTextChanged()));
connect(ploter, SIGNAL(setStatusMessage(QString)),
statusBar(), SLOT(showMessage(QString)));
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_actionOpen_File_triggered()
{
QString filePath = QFileDialog::getOpenFileName(this, tr("Open File"),
QDir::homePath(),
tr("WAV files")+" (*.wav)");
ploter->setupView(filePath);
}