-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrecordshower.cpp
More file actions
34 lines (29 loc) · 1.03 KB
/
Copy pathrecordshower.cpp
File metadata and controls
34 lines (29 loc) · 1.03 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
#include "recordshower.h"
#include "ui_recordshower.h"
RecordShower::RecordShower(QWidget *parent)
: QWidget(parent)
, ui(new Ui::RecordShower)
{
ui->setupUi(this);
}
RecordShower::~RecordShower()
{
delete ui;
}
void RecordShower::showRecords(const RecordManager &RM)
{
ui->treeWidget_Records->clear();
ui->treeWidget_Records->setHeaderLabels(QStringList() << "Records" << "");
for (const auto& [dateStr, dateEntry] : RM.date_entries)
{
QTreeWidgetItem* dateItem = new QTreeWidgetItem(ui->treeWidget_Records);
dateItem->setText(0, QString::fromStdString(dateStr));
dateItem->setFirstColumnSpanned(true);
for (const auto& [recordId, record] : dateEntry.records)
{
QTreeWidgetItem* recordItem = new QTreeWidgetItem(dateItem);
recordItem->setText(0, QString::fromStdString(record.getTitle()));
recordItem->setText(1, QString::fromStdString(record.getCompletedStats() ? "Complete" : "Overdue"));
}
}
}