-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathparserecord.cpp
More file actions
49 lines (39 loc) · 1.05 KB
/
parserecord.cpp
File metadata and controls
49 lines (39 loc) · 1.05 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
#include "parserecord.h"
#include <QDebug>
ParseRecord::ParseRecord() : rowPos(1){
}
ParseRecord::~ParseRecord(){
}
void ParseRecord::setNextRecord(void){
if (rowPos < getRowCount()-1) {
rowPos += 1;
}
}
void ParseRecord::setPrevRecord(void){
if (rowPos > 1) {
rowPos -= 1;
}
}
int ParseRecord::getColumnCount(void){
return dataStore->currentWorksheet()->dimension().columnCount();
}
int ParseRecord::getCurrentRow(void){
return rowPos;
}
int ParseRecord::getRowCount(void){
return dataStore->currentWorksheet()->dimension().rowCount();
}
QStringList ParseRecord::getRow(int row){
QStringList list;
for(int i= 1;i <= getColumnCount();i++){
if (dataStore->cellAt(row,i) != NULL){
if (dataStore->cellAt(row,i)->isDateTime()) {
QString format("MM/dd/yyyy");
list << dataStore->cellAt(row,i)->dateTime().toString(format);
} else {
list << dataStore->cellAt(row,i)->value().toString();
}
}
}
return list;
}