-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenders.cpp
62 lines (48 loc) · 848 Bytes
/
genders.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
58
59
60
61
62
#include "genders.h"
// Genders
Genders::Genders() {}
void Genders::insert(const QString &index, const QString &str)
{
QString i = index;
if (i == "")
i = "0";
/* else if (i == "namesFemale")
{
i = "1";
}
else if (i == "namesNeutral")
{
i = "2";
} */
m.insert(i, str);
}
void Genders::insert(int index, const QString& str)
{
m.insert(QString::number(index), str);
}
QString Genders::operator[](QString idx)
{
return m[idx];
}
QString Genders::operator[](int idx)
{
return m[QString::number(idx)];
}
QString Genders::operator[]()
{
return m["0"];
}
QMap<QString, QString> &Genders::getMap()
{
return m;
}
// Choices
Choices::Choices() {}
void Choices::insert(const QString &str)
{
l.append(str);
}
QList<QString> &Choices::getList()
{
return l;
}