Subversion Repositories svn1

Rev

Rev 189 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

#include "qmeventstatus.h"
#include "ui_qmeventstatus.h"
#include "qmstatusitem.h"
#include "QGroupBox"
#include    "consts.h"
#include    "structs.h"
#include    "proto.h"

QmEventStatus::QmEventStatus(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::QmEventStatus)
{
    //ui->setupUi(this);
    resize ( 500,400);

    verticalLayout = new QVBoxLayout(this);
    verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
    verticalLayout->setContentsMargins(0, 0, 0, 0);
    scrollArea = new QScrollArea(this);
    scrollArea->setObjectName(QString::fromUtf8("scrollArea"));
    scrollArea->setWidgetResizable(true);
    scrollAreaWidgetContents = new QWidget();
    scrollAreaWidgetContents->setObjectName(QString::fromUtf8("scrollAreaWidgetContents"));
    scrollAreaWidgetContents->setGeometry(QRect(0, 0, 395, 264));
    scrollArea->setWidget(scrollAreaWidgetContents);

    verticalLayout->addWidget(scrollArea);

    buttonBox = new QDialogButtonBox(this);
    buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
    buttonBox->setOrientation(Qt::Horizontal);
    buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);

    verticalLayout->addWidget(buttonBox);


    QObject::connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    QObject::connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));

    QVBoxLayout *verticalLayout2 = new QVBoxLayout(scrollAreaWidgetContents);

    for( int j = 0; j <= config.num_class; j++ )
    {
        QGroupBox * groupBox = new QGroupBox(j ? config.team_class[j - 1].full_name : "Complete Event");
        groupBox->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
        verticalLayout2->addWidget(groupBox);
        QHBoxLayout * horizontalLayout = new QHBoxLayout(groupBox);

        for( int i = 0; i <= config.num_legs; i++ )
        {
            QmStatusItem * item = new QmStatusItem(i ? config.leg_name[i - 1] : "Overall");
            item->setData(stats.fast.team[i][j], stats.fast.time[i][j],stats.average[i][j] );
            horizontalLayout->addWidget ( item );
        }
    }
}

QmEventStatus::~QmEventStatus()
{
    delete ui;
}