-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathselezionedialog.cpp
31 lines (29 loc) · 1.16 KB
/
selezionedialog.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
#include "selezionedialog.h"
SelezioneDialog::SelezioneDialog(QWidget *parent): QDialog(parent), _combo(new QComboBox), _regular(new QCheckBox), _layout(new QVBoxLayout), _explanation(new QLabel), _conferma(new QHBoxLayout), _ok(new QPushButton), _no(new QPushButton)
{
setWindowTitle("Tipo di incarico");
setModal(true);
_explanation->setText("Seleziona la tipologia di incarico che vuoi creare");
_layout->addWidget(_explanation);
_combo->addItem("Bolletta");
_combo->addItem("Spesa");
_combo->addItem("Pulizia");
_combo->addItem("Cucina");
_combo->addItem("Spazzatura");
_layout->addWidget(_combo);
_regular->setText("Incarico regolare");
_layout->addWidget(_regular);
_ok->setText("Ok");
_no->setText("Annulla");
_conferma->addWidget(_ok);
_conferma->addWidget(_no);
connect(_no, SIGNAL(clicked()), this, SLOT(close()));
connect(_ok, SIGNAL(clicked()), this, SLOT(inoltraDati()));
connect(_ok, SIGNAL(clicked()), this, SLOT(close()));
_layout->addLayout(_conferma);
setLayout(_layout);
}
void SelezioneDialog::inoltraDati()
{
emit datiSelezionati(_combo->currentText(), _regular->isChecked());
}