-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcolumnnames.cpp
More file actions
52 lines (43 loc) · 968 Bytes
/
Copy pathcolumnnames.cpp
File metadata and controls
52 lines (43 loc) · 968 Bytes
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
#include "columnnames.h"
ColumnNames::ColumnNames()
{
upToDate =false;
}
const QString &ColumnNames::getName(const int index) const
{
return numberSortedData.at(index);
}
int ColumnNames::getIndex(const QString &name) const
{
return textSortedData.value(name);
}
void ColumnNames::setData(QStringList names)
{
numberSortedData = names;
numberSortedToTextSorted();
}
void ColumnNames::appendData(QString name)
{
numberSortedData.append(name);
textSortedData.insert(name,numberSortedData.length() - 1);
}
void ColumnNames::clearData()
{
textSortedData.clear();
numberSortedData.clear();
}
void ColumnNames::setUpToDate(bool upToDate)
{
this->upToDate = upToDate;
}
bool ColumnNames::isUpToDate() const
{
return upToDate;
}
void ColumnNames::numberSortedToTextSorted()
{
textSortedData.clear();
for(int i=0; i<numberSortedData.length(); i++) {
textSortedData.insert(numberSortedData.at(i), i);
}
}