forked from MonthMoonBird/LabelRoboMaster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfiguredialog.cpp
32 lines (28 loc) · 993 Bytes
/
configuredialog.cpp
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
#include "configuredialog.h"
#include "ui_configuredialog.h"
Configuredialog::Configuredialog(Configure *config, QWidget *parent) :
QDialog(parent),
ui(new Ui::Configuredialog)
{
ui->setupUi(this);
connect(ui->cancelPushButton, &QPushButton::clicked, [=](){close();});
connect(ui->PDSlider, &QSlider::valueChanged, [=](){ui->pointDistanceLabel->setText(QString::number(ui->PDSlider->value() / 10.));});
connect(ui->VRSlider, &QSlider::valueChanged, [=](){ui->vRateLabel->setText(QString::number(ui->VRSlider->value() / 10.));});
configure = config;
}
Configuredialog::~Configuredialog()
{
delete ui;
}
void Configuredialog::on_OKPushButton_clicked()
{
configure->point_distance = ui->PDSlider->value() / 10.;
configure->V_rate = ui->VRSlider->value() / 10.;
close();
}
void Configuredialog::show_configure()
{
ui->PDSlider->setValue(int(configure->point_distance * 10));
ui->VRSlider->setValue(int(configure->V_rate * 10));
show();
}