-
Notifications
You must be signed in to change notification settings - Fork 0
/
dialog.cpp
55 lines (51 loc) · 1.5 KB
/
dialog.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
#include "dialog.h"
#include "ui_dialog.h"
#include "iostream"
Dialog::Dialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::Dialog)
{
ui->setupUi(this);
this->setWindowTitle("Puan Tablosu");
}
Dialog::~Dialog()
{
delete ui;
}
void Dialog::setAllTeams(vector<Takim> &a){
allTeams = a;
ui->tableWidget->setRowCount(allTeams.size());
for (int i =0; i<allTeams.size();i++ ) {
QTableWidgetItem *b;
for(int j =0 ; j <8;j++){
b = new QTableWidgetItem;
switch (j) {
case 0:
b->setText(QString::number(allTeams[i].getCountWin()));
break;
case 1:
b->setText(QString::fromStdString(allTeams[i].getName()));
break;
case 2:
b->setText(QString::number(allTeams.size()-1));
break;
case 3:
b->setText(QString::number(allTeams[i].getCountWin()));
break;
case 4:
b->setText(QString::number(allTeams[i].getCountDraw()));
break;
case 5:
b->setText(QString::number(allTeams[i].getCountLose()));
break;
case 6:
b->setText(QString::number(allTeams[i].getCountGoal()));
break;
case 7:
b->setText(QString::number(allTeams[i].getLeaguePoint()));
break;
}
ui->tableWidget->setItem(i,j,b);
}
}
}