-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaddtimerwindow.cpp
More file actions
62 lines (56 loc) · 1.33 KB
/
Copy pathaddtimerwindow.cpp
File metadata and controls
62 lines (56 loc) · 1.33 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include "addtimerwindow.h"
#include "ui_addtimerwindow.h"
#include <QString>
#include <string>
AddTimerWindow::AddTimerWindow(QWidget *parent) :
QDialog(parent),
ui(new Ui::AddTimerWindow)
{
ui->setupUi(this);
}
AddTimerWindow::~AddTimerWindow()
{
delete ui;
}
void AddTimerWindow::on_pushButton_2_clicked()
{
close();
}
void AddTimerWindow::on_pushButton_clicked()
{
int checkForSpace = 0;
bool checkbox = false;
QString LineText = "";
QString Name = "";
QString time = ui->timeEdit->text();
if(ui->checkBox->isChecked()){
LineText = ui->lineEdit->text();
}
if(ui->checkBox_2->isChecked()){
checkbox = true;
}
Name = ui->lineEdit_2->text();
if(LineText.size() > 20){
ui->label_3->setText("Більше 20 символів");
}
if(time == "00:00:00"){
ui->label_5->setText("Таймера немає");
}
for(int i = 0; i < Name.size(); i++){
if(Name[i] == ' '){
checkForSpace++;
}
}
if(checkForSpace == Name.size()){
Name = "";
}
if(Name.size() <= 20){
if(LineText.size() <= 20 && time != "00:00:00"){
emit signal(time, LineText, Name , checkbox);
close();
}
}
else{
ui->label_4->setText("Більше 20 символів");
}
}