-
Notifications
You must be signed in to change notification settings - Fork 0
/
madddocumenttypedialog.cpp
47 lines (35 loc) · 1.28 KB
/
madddocumenttypedialog.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
#include "madddocumenttypedialog.h"
#include "ui_madddocumenttypedialog.h"
mAddDocumentTypeDialog::mAddDocumentTypeDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::mAddDocumentTypeDialog)
{
ui->setupUi(this);
Qt::WindowFlags flags(this->windowFlags());
setWindowFlags(flags ^ Qt::WindowContextHelpButtonHint
| Qt::MSWindowsFixedSizeDialogHint
);
setWindowTitle("Тип документа");
setAttribute(Qt::WA_DeleteOnClose);
this->connect(ui->cancelPushButton,
SIGNAL(clicked(bool)), SLOT(reject()));
this->connect(ui->okPushButton,
SIGNAL(clicked(bool)), SLOT(formCortege()));
}
void mAddDocumentTypeDialog::formCortege() {
QList <QVariant> tmp;
tmp << ui->nameLineEdit->text() << ui->contestCheckBox->isChecked()
<< ui->mandatoryCheckBox->isChecked();
setVisible(false);
emit cortegeFormed(tmp);
close();
}
void mAddDocumentTypeDialog::fillCortege(const QSqlRecord & rec) {
ui->nameLineEdit->setText(rec.value(1).toString());
ui->contestCheckBox->setChecked(rec.value("is_contest").toBool());
ui->mandatoryCheckBox->setChecked(rec.value("is_mandatory").toBool());
}
mAddDocumentTypeDialog::~mAddDocumentTypeDialog()
{
delete ui;
}