-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetcircledialog.cpp
34 lines (28 loc) · 1020 Bytes
/
setcircledialog.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
33
34
#include "setcircledialog.h"
#include "ui_setcircledialog.h"
SetCircleDialog::SetCircleDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::SetCircleDialog)
{
ui->setupUi(this);
connect(ui->lineEditCentreX, SIGNAL(textChanged(QString)), SLOT(setCentre()));
connect(ui->lineEditCentreY, SIGNAL(textChanged(QString)), SLOT(setCentre()));
connect(ui->lineEditWidth, SIGNAL(textChanged(QString)), SLOT(setSize()));
connect(ui->lineEditHeight, SIGNAL(textChanged(QString)), SLOT(setSize()));
ui->lineEditCentreX->setText("0");
ui->lineEditCentreY->setText("0");
ui->lineEditWidth->setText("100");
ui->lineEditHeight->setText("100");
}
SetCircleDialog::~SetCircleDialog()
{
delete ui;
}
void SetCircleDialog::setCentre()
{
emit changeCentre(QPointF(ui->lineEditCentreX->text().toDouble(), ui->lineEditCentreY->text().toDouble()));
}
void SetCircleDialog::setSize()
{
emit changeSize(ui->lineEditWidth->text().toDouble(), ui->lineEditHeight->text().toDouble());
}