-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdialog2.cpp
57 lines (50 loc) · 1.16 KB
/
dialog2.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include "dialog2.hpp"
#include "ui_dialog2.h"
Dialog2::Dialog2(QWidget *parent)
: QDialog(parent)
, ui(new Ui::Dialog2)
{
ui->setupUi(this);
}
Dialog2::~Dialog2()
{
delete ui;
}
void Dialog2::on_pushButton_browse_clicked()
{
// open file dialog
}
void Dialog2::on_pushButton_ok_clicked()
{
QVector<QString> qvNew;
qvNew.append(ui->lineEdit_phrase->text());
ui->lineEdit_phrase->setText("");
qvNew.append(ui->lineEdit_prog->text());
ui->lineEdit_prog->setText("");
qvNew.append(ui->lineEdit_param->text());
ui->lineEdit_param->setText("");
emit AddPhraseData(qvNew);
this->accept();
}
void Dialog2::on_pushButton_cancel_clicked()
{
ui->lineEdit_phrase->setText("");
ui->lineEdit_prog->setText("");
ui->lineEdit_param->setText("");
ui->pushButton_ok->setDisabled(true);
this->reject();
}
void Dialog2::on_lineEdit_phrase_textEdited(const QString &arg1)
{
if(!arg1.isEmpty())
{
ui->pushButton_ok->setDisabled(false);
}
}
void Dialog2::on_lineEdit_prog_textEdited(const QString &arg1)
{
if(!arg1.isEmpty())
{
ui->pushButton_ok->setDisabled(false);
}
}