-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathparsecell.cpp
More file actions
53 lines (44 loc) · 1.09 KB
/
parsecell.cpp
File metadata and controls
53 lines (44 loc) · 1.09 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
#include "parsecell.h"
ParseCell::ParseCell() : columnPos(0){
}
ParseCell::~ParseCell(){
}
void ParseCell::setNextCell(void){
if (columnPos < getColumnCount()-1) {
columnPos += 1;
} else {
setNextRecord();
}
}
void ParseCell::setPrevCell(void){
if (columnPos > 0) {
columnPos -= 1;
} else {
columnPos = getColumnCount()-1;
ParseRecord::setPrevRecord();
}
}
int ParseCell::getCurrentColumn(void){
return columnPos;
}
QVariant ParseCell::getCell(int row, int column){
QVariant val1;
if (dataStore->cellAt(row,column) != NULL){
QXlsx::Cell *val3(dataStore->cellAt(row,column));
if (val3->isDateTime()) {
QString format("MM/dd/yyyy");
val1 = QVariant(val3->dateTime().toString(format));
} else {
val1 = QVariant(dataStore->cellAt(row,column)->value().toString());
}
}
return val1;
}
void ParseCell::setNextRecord(){
columnPos = 0;
ParseRecord::setNextRecord();
}
void ParseCell::setPrevRecord(){
columnPos = 0;
ParseRecord::setPrevRecord();
}