54 lines
1.6 KiB
C++
54 lines
1.6 KiB
C++
#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
|