| 192 |
- |
1 |
#include "qmeventstatus.h"
|
|
|
2 |
#include "ui_qmeventstatus.h"
|
|
|
3 |
#include "qmstatusitem.h"
|
|
|
4 |
#include "QGroupBox"
|
|
|
5 |
#include "consts.h"
|
|
|
6 |
#include "structs.h"
|
|
|
7 |
#include "proto.h"
|
|
|
8 |
|
|
|
9 |
QmEventStatus::QmEventStatus(QWidget *parent) :
|
|
|
10 |
QDialog(parent),
|
|
|
11 |
ui(new Ui::QmEventStatus)
|
|
|
12 |
{
|
|
|
13 |
//ui->setupUi(this);
|
|
|
14 |
resize ( 500,400);
|
|
|
15 |
|
|
|
16 |
verticalLayout = new QVBoxLayout(this);
|
|
|
17 |
verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
|
|
|
18 |
verticalLayout->setContentsMargins(0, 0, 0, 0);
|
|
|
19 |
scrollArea = new QScrollArea(this);
|
|
|
20 |
scrollArea->setObjectName(QString::fromUtf8("scrollArea"));
|
|
|
21 |
scrollArea->setWidgetResizable(true);
|
|
|
22 |
scrollAreaWidgetContents = new QWidget();
|
|
|
23 |
scrollAreaWidgetContents->setObjectName(QString::fromUtf8("scrollAreaWidgetContents"));
|
|
|
24 |
scrollAreaWidgetContents->setGeometry(QRect(0, 0, 395, 264));
|
|
|
25 |
scrollArea->setWidget(scrollAreaWidgetContents);
|
|
|
26 |
|
|
|
27 |
verticalLayout->addWidget(scrollArea);
|
|
|
28 |
|
|
|
29 |
buttonBox = new QDialogButtonBox(this);
|
|
|
30 |
buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
|
|
|
31 |
buttonBox->setOrientation(Qt::Horizontal);
|
|
|
32 |
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
|
|
|
33 |
|
|
|
34 |
verticalLayout->addWidget(buttonBox);
|
|
|
35 |
|
|
|
36 |
|
|
|
37 |
QObject::connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
|
|
38 |
QObject::connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
|
|
39 |
|
|
|
40 |
QVBoxLayout *verticalLayout2 = new QVBoxLayout(scrollAreaWidgetContents);
|
|
|
41 |
|
|
|
42 |
for( int j = 0; j <= config.num_class; j++ )
|
|
|
43 |
{
|
|
|
44 |
QGroupBox * groupBox = new QGroupBox(j ? config.team_class[j - 1].full_name : "Complete Event");
|
|
|
45 |
groupBox->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
|
|
|
46 |
verticalLayout2->addWidget(groupBox);
|
|
|
47 |
QHBoxLayout * horizontalLayout = new QHBoxLayout(groupBox);
|
|
|
48 |
|
|
|
49 |
for( int i = 0; i <= config.num_legs; i++ )
|
|
|
50 |
{
|
|
|
51 |
QmStatusItem * item = new QmStatusItem(i ? config.leg_name[i - 1] : "Overall");
|
|
|
52 |
item->setData(stats.fast.team[i][j], stats.fast.time[i][j],stats.average[i][j] );
|
|
|
53 |
horizontalLayout->addWidget ( item );
|
|
|
54 |
}
|
|
|
55 |
}
|
|
|
56 |
}
|
|
|
57 |
|
|
|
58 |
QmEventStatus::~QmEventStatus()
|
|
|
59 |
{
|
|
|
60 |
delete ui;
|
|
|
61 |
}
|