-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathflowlistwidget.cpp
More file actions
55 lines (46 loc) · 1.24 KB
/
Copy pathflowlistwidget.cpp
File metadata and controls
55 lines (46 loc) · 1.24 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
#include "flowlistwidget.h"
#include "ui_flowlistwidget.h"
FlowListWidget::FlowListWidget(QWidget *parent)
: QWidget{parent}
, ui(new Ui::FlowListWidget)
{
ui->setupUi(this);
}
FlowListWidget::~FlowListWidget()
{
delete ui;
}
void FlowListWidget::setStep(Step s)
{
int p = Basic::searchWeapon(s.a.name);
if(p != -1)
ui->iconA->setIcon(Basic::weapon[p].icon);
else
ui->iconA->setIcon(QIcon(":/icon/res/enchanted_book.png"));
p = Basic::searchWeapon(s.b.name);
if(p != -1)
ui->iconB->setIcon(Basic::weapon[p].icon);
else
ui->iconB->setIcon(QIcon(":/icon/res/enchanted_book.png"));
QString str = "";
for(int i = 0; i < INIT_LENGTH && !s.a.ench[i].name.isEmpty(); i++)
{
if(i != 0)
str+= '\n';
str += s.a.ench[i].name;
str += " ";
str += Basic::IntToRoman(s.a.ench[i].lvl);
}
ui->enchA->setText(str);
str = "";
for(int i = 0; i < INIT_LENGTH && !s.b.ench[i].name.isEmpty(); i++)
{
if(i != 0)
str+= '\n';
str += s.b.ench[i].name;
str += " ";
str += Basic::IntToRoman(s.b.ench[i].lvl);
}
ui->enchB->setText(str);
ui->cost->setText(QString::number(s.cost));
}