Migrated old visualization of the bidding round statuses with donut charts from the legacy BeetRound project.
This commit is contained in:
53
UIs/BeetRoundWidgets/widgets/biddingroundstatuswidget.h
Normal file
53
UIs/BeetRoundWidgets/widgets/biddingroundstatuswidget.h
Normal file
@ -0,0 +1,53 @@
|
||||
#ifndef BIDDINGROUNDSTATUSWIDGET_H
|
||||
#define BIDDINGROUNDSTATUSWIDGET_H
|
||||
|
||||
#include "biddingroundprogresslayout.h"
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
class QBoxLayout;
|
||||
class QChartView;
|
||||
class QPieSeries;
|
||||
class QPieSlice;
|
||||
|
||||
class BiddingRoundStatusWidget : public QWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit BiddingRoundStatusWidget(const QString& title,
|
||||
const int placedBiddings,
|
||||
const int expectedBiddings,
|
||||
const int financialNeed,
|
||||
const int currentSum,
|
||||
const qreal currentAverage,
|
||||
QWidget* parent = nullptr);
|
||||
|
||||
public slots:
|
||||
void onExpectedBiddingsChanged(const int nExpected);
|
||||
void onNPlacedBiddingsChanged(const int nPlaced);
|
||||
void onBiddingSumChanged(const int sum);
|
||||
void onBiddingAverageChanged(const qreal average);
|
||||
void onFinancialNeedChanged(const int financialNeed);
|
||||
|
||||
signals:
|
||||
|
||||
private:
|
||||
QString m_title;
|
||||
int m_financialNeed;
|
||||
int m_currentSum;
|
||||
|
||||
QChartView* m_chartView = nullptr;
|
||||
QPieSeries* m_moneyDonutSeries = nullptr;
|
||||
QPieSlice* m_sumSlice = nullptr;
|
||||
QPieSlice* m_gapSlice = nullptr;
|
||||
QLabel* m_biddingAverageDescription = nullptr;
|
||||
QLabel* m_biddingAverageValue = nullptr;
|
||||
|
||||
BiddingRoundProgressLayout* m_biddingRoundProgress = nullptr;
|
||||
|
||||
QBoxLayout* createProgressLayout(const int nPlaced, const int nExpected);
|
||||
void updateDonutChart();
|
||||
|
||||
QString createCurrencyString(const qreal value) const;
|
||||
};
|
||||
|
||||
#endif // BIDDINGROUNDSTATUSWIDGET_H
|
||||
Reference in New Issue
Block a user