forked from CCi-BClark/NERD
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrecordwindow.cpp
More file actions
61 lines (50 loc) · 1.42 KB
/
recordwindow.cpp
File metadata and controls
61 lines (50 loc) · 1.42 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
#include "recordwindow.h"
#include "ui_recordwindow.h"
#include <QDebug>
RecordWindow::RecordWindow(QWidget *parent) :
QDialog(parent),
ui(new Ui::RecordWindow){
ui->setupUi(this);
}
RecordWindow::~RecordWindow(){
delete ui;
}
void RecordWindow::setRecords(QXlsx::Document *&file){
dataStore = file;
setRecordTotal();
setRecordNum(1);
}
void RecordWindow::setRecordNum(int rec){
currentR = (int)rec;
QString line,
tcount;
tcount.setNum(total);
line.setNum(currentR).append(" / ").append(tcount);
ui->labCurrentNum->setText(line);
setRecordDisplay();
}
void RecordWindow::setRecordTotal(){
total = (int)dataStore->dimension().rowCount()-1;
}
void RecordWindow::setRecordDisplay(){
ui->listData->clear();
for(int i = 1; i < (int)dataStore->dimension().columnCount()+1; i++){
QString line(dataStore->read(1, i).toString() + " : ");
line.append(dataStore->read(currentR+1, i).toString());
ui->listData->insertItem(i-1,line);
}
setDataItem(0);
}
void RecordWindow::setDataItem(int item){
currentC = item;
ui->listData->itemSelectionChanged();
ui->listData->item(currentC)->setSelected(true);
setClipBoard();
}
void RecordWindow::setClipBoard(){
clipboard = QApplication::clipboard();
clipboard->setText(dataStore->read(currentR+1, currentC+1).toString());
}
int RecordWindow::getRecordNum(){
return currentR;
}