2 #include <QDoubleValidator>
3 #include "ui_scale_transform.h"
9 ui->lineEditTimeOffset->setValidator(
new QDoubleValidator());
10 ui->lineEditValueOffset->setValidator(
new QDoubleValidator());
11 ui->lineEditValueScale->setValidator(
new QDoubleValidator());
13 connect(
ui->buttonDegRad, &QPushButton::clicked,
this, [=]() {
14 const double deg_rad = 3.14159265359 / 180;
15 ui->lineEditValueScale->setText(QString::number(deg_rad,
'g', 5));
16 emit parametersChanged();
19 connect(
ui->buttonRadDeg, &QPushButton::clicked,
this, [=]() {
20 const double rad_deg = 180.0 / 3.14159265359;
21 ui->lineEditValueScale->setText(QString::number(rad_deg,
'g', 5));
22 emit parametersChanged();
25 connect(
ui->lineEditTimeOffset, &QLineEdit::editingFinished,
this,
26 [=]() { emit parametersChanged(); });
27 connect(
ui->lineEditValueOffset, &QLineEdit::editingFinished,
this,
28 [=]() { emit parametersChanged(); });
29 connect(
ui->lineEditValueScale, &QLineEdit::editingFinished,
this,
30 [=]() { emit parametersChanged(); });
46 QDomElement widget_el = doc.createElement(
"options");
47 widget_el.setAttribute(
"time_offset",
ui->lineEditTimeOffset->text());
48 widget_el.setAttribute(
"value_offset",
ui->lineEditValueOffset->text());
49 widget_el.setAttribute(
"value_scale",
ui->lineEditValueScale->text());
50 parent_element.appendChild(widget_el);
57 QDomElement widget_el = parent_element.firstChildElement(
"options");
58 if (widget_el.isNull())
62 ui->lineEditTimeOffset->setText(widget_el.attribute(
"time_offset"));
63 ui->lineEditValueOffset->setText(widget_el.attribute(
"value_offset"));
64 ui->lineEditValueScale->setText(widget_el.attribute(
"value_scale"));
70 double off_x =
ui->lineEditTimeOffset->text().toDouble();
71 double off_y =
ui->lineEditValueOffset->text().toDouble();
72 double scale =
ui->lineEditValueScale->text().toDouble();