-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaddscoredialog.cpp
More file actions
67 lines (52 loc) · 1.8 KB
/
Copy pathaddscoredialog.cpp
File metadata and controls
67 lines (52 loc) · 1.8 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
62
63
64
65
66
67
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QPushButton>
#include <QButtonGroup>
#include "database.h"
#include "addscoredialog.h"
AddScoreDialog::AddScoreDialog(QWidget* parent) : QDialog(parent)
{
QVBoxLayout* main = new QVBoxLayout(this);
m_name = new QLineEdit(this);
main->addWidget(m_name);
QButtonGroup* radioGroup = new QButtonGroup(this);
m_none = new QRadioButton(tr("None"), this);
radioGroup->addButton(m_none);
main->addWidget(m_none);
m_active = new QRadioButton(tr("Active"), this);
radioGroup->addButton(m_active);
main->addWidget(m_active);
m_passive = new QRadioButton(tr("Passive"), this);
radioGroup->addButton(m_passive);
main->addWidget(m_passive);
m_income = new QRadioButton(tr("Incomings"), this);
radioGroup->addButton(m_income);
main->addWidget(m_income);
m_cost = new QRadioButton(tr("Spendings"), this);
m_cost->setChecked(true);
radioGroup->addButton(m_cost);
main->addWidget(m_cost);
QHBoxLayout* buttonsLayout = new QHBoxLayout();
main->addLayout(buttonsLayout);
QPushButton* ok = new QPushButton(tr("OK"), this);
buttonsLayout->addWidget(ok);
connect(ok, SIGNAL(clicked()), this, SLOT(accept()));
QPushButton* cancel = new QPushButton(tr("Cancel"), this);
buttonsLayout->addWidget(cancel);
connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));
}
quint64 AddScoreDialog::flags() const
{
quint64 flags = DataBase::eNone;
if (m_none->isChecked())
return flags;
if (m_active->isChecked())
flags |= DataBase::eActive;
if (m_passive->isChecked())
flags |= DataBase::ePassive;
if (m_income->isChecked())
flags |= DataBase::eIncoming;
if (m_cost->isChecked())
flags |= DataBase::eSpending;
return flags;
}