-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshow.cpp
51 lines (40 loc) · 1.08 KB
/
show.cpp
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
#include "show.h"
#include "ui_show.h"
#include "servermanager.h"
CShow::CShow(QWidget *parent) :
QDialog(parent),
ui(new Ui::CShow)
{
ui->setupUi(this);
}
CShow::~CShow()
{
delete ui;
}
void CShow::on_pushButton_clicked()
{
hide();
}
void CShow::on_pushButton_2_clicked()
{
auto tableData = std::move(CServerManager::getReference().getTableData());
ui->tableWidget->setRowCount(tableData.size());
ui->tableWidget->setColumnCount(std::begin(tableData)->second.size());
QStringList lables;
for (auto& lable : std::begin(tableData)->second)
{
lables << ((lable.first).split("_"))[1];
}
ui->tableWidget->setHorizontalHeaderLabels(lables);
ui->tableWidget->verticalHeader()->setVisible(false);
for (auto& outer : tableData)
{
int innerIdx(0);
int outerIdx(outer.first);
for (auto& inner : outer.second)
{
ui->tableWidget->setColumnWidth(innerIdx, inner.second.size()+154);
ui->tableWidget->setItem(outerIdx, innerIdx++, new QTableWidgetItem(inner.second));
}
}
}