Migrated old visualization of the bidding round statuses with donut charts from the legacy BeetRound project.
This commit is contained in:
44
UIs/BeetRoundWidgets/widgets/biddingroundprogresslayout.cpp
Normal file
44
UIs/BeetRoundWidgets/widgets/biddingroundprogresslayout.cpp
Normal file
@ -0,0 +1,44 @@
|
||||
#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);
|
||||
}
|
||||
Reference in New Issue
Block a user