-
Notifications
You must be signed in to change notification settings - Fork 4
/
wininfotests.cpp
executable file
·70 lines (57 loc) · 1.33 KB
/
wininfotests.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#include "wininfotests.h"
#include "ui_wininfotests.h"
WinInfoTests::WinInfoTests(QWidget *parent) :
QDialog(parent),
ui(new Ui::WinInfoTests)
{
ui->setupUi(this);
load_info_tests();
on_slc_tests_currentIndexChanged(0);
}
WinInfoTests::~WinInfoTests()
{
delete ui;
}
void WinInfoTests::on_slc_tests_currentIndexChanged(int index)
{
switch(index)
{
case 0: ui->textBrowser->setText(info_tests.aggr_info);
break;
case 1: ui->textBrowser->setText(info_tests.comm_info);
break;
default: break;
}
}
bool WinInfoTests::load_info_tests()
{
QFile file_tests(":/info_test.txt");
if (!file_tests.open(QIODevice::ReadOnly | QIODevice::Text))
return false;
QString num_test(file_tests.readLine());
QString line;
bool is_num;
while(!file_tests.atEnd())
{
line = QString(file_tests.readLine());
line.toInt(&is_num,10);
if(is_num)
{
num_test = line;
line = QString(file_tests.readLine());
}
switch(num_test.toInt())
{
case 0: info_tests.aggr_info.append(line);
break;
case 1: info_tests.comm_info.append(line);
break;
default: break;
}
}
return true;
}
void WinInfoTests::on_btn_back_clicked()
{
this->close();
}