45 lines
1.6 KiB
C++
45 lines
1.6 KiB
C++
#include "biddingroundprogresslayout.h"
|
|
|
|
#include <QLabel>
|
|
#include <QProgressBar>
|
|
|
|
BiddingRoundProgressLayout::BiddingRoundProgressLayout(const int nCurrentBiddings,
|
|
const int nExpectedBiddings,
|
|
QWidget* parent)
|
|
: QHBoxLayout(parent)
|
|
, m_nCurrentBiddings(nCurrentBiddings)
|
|
, m_nExpectedBiddings(nExpectedBiddings) {
|
|
QLabel* nBidsText = new QLabel("Abgegeben:");
|
|
addWidget(nBidsText);
|
|
|
|
m_nBiddings1Label = new QLabel(QString::number(m_nCurrentBiddings));
|
|
addWidget(m_nBiddings1Label);
|
|
|
|
QLabel* nExpectedText = new QLabel("Erwartet:");
|
|
addWidget(nExpectedText);
|
|
|
|
m_nExpectedBidding1Label = new QLabel(QString::number(m_nExpectedBiddings));
|
|
addWidget(m_nExpectedBidding1Label);
|
|
|
|
m_biddingRound1ProgressBar = new QProgressBar(parent);
|
|
m_biddingRound1ProgressBar->setMinimum(0);
|
|
m_biddingRound1ProgressBar->setMaximum(m_nExpectedBiddings);
|
|
m_biddingRound1ProgressBar->setValue(m_nCurrentBiddings);
|
|
|
|
addWidget(m_biddingRound1ProgressBar);
|
|
}
|
|
|
|
void BiddingRoundProgressLayout::setCurrentBiddings(const int value) {
|
|
m_nCurrentBiddings = value;
|
|
const QString bidCountString = QString::number(value);
|
|
m_nBiddings1Label->setText(bidCountString);
|
|
m_biddingRound1ProgressBar->setValue(value);
|
|
}
|
|
|
|
void BiddingRoundProgressLayout::setExpectedBiddings(const int value) {
|
|
m_nExpectedBiddings = value;
|
|
const QString expectedBiddingsString = QString::number(value);
|
|
m_nExpectedBidding1Label->setText(expectedBiddingsString);
|
|
m_biddingRound1ProgressBar->setMaximum(value);
|
|
}
|