-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathremarkinput.cpp
More file actions
35 lines (27 loc) · 766 Bytes
/
remarkinput.cpp
File metadata and controls
35 lines (27 loc) · 766 Bytes
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 "remarkinput.h"
#include "ui_remarkinput.h"
#include "utilities.h"
RemarkInput::RemarkInput(QWidget *parent, QString label) : QDialog(parent), ui(new Ui::RemarkInput) {
ui->setupUi(this);
ui->remark->setFocus();
ui->label->setText(label);
ui->errorL->setText("");
ui->errorL->setStyleSheet("QLabel {color: red};");
}
RemarkInput::~RemarkInput() {
delete ui;
}
QString RemarkInput::getRemark() {
return this->remark;
}
void RemarkInput::on_ok_clicked() {
if (invalid_remark(ui->remark->text())) {
ui->errorL->setText("remark can't exceed 50 characters !");
return;
}
this->remark = ui->remark->text().replace("\"", "\\\"");
close();
}
void RemarkInput::on_cancel_clicked() {
close();
}