命名规范
This commit is contained in:
@@ -1,35 +1,35 @@
|
||||
#ifndef ProgressBar_H
|
||||
#define ProgressBar_H
|
||||
#ifndef Progress_Bar_H
|
||||
#define Progress_Bar_H
|
||||
#include <utility>
|
||||
|
||||
#include "../Global.h"
|
||||
|
||||
struct Tick{
|
||||
QString mText;
|
||||
QColor mColor;
|
||||
double mValue = 0;
|
||||
Tick(QString text, QColor color) : mText(std::move(text)), mColor(std::move(color)){
|
||||
QString that = (mText[0] == '+' || mText[0] == '-' || mText[0] == '<' || mText[0] == '>') ? mText.mid(1) : mText;
|
||||
mValue = that.toDouble();
|
||||
QString text;
|
||||
QColor color;
|
||||
double value = 0;
|
||||
Tick(QString text, QColor color) : text(std::move(text)), color(std::move(color)){
|
||||
QString that = (text[0] == '+' || text[0] == '-' || text[0] == '<' || text[0] == '>') ? text.mid(1) : text;
|
||||
value = that.toDouble();
|
||||
}
|
||||
Tick(QString text, QColor color, double value) : mText(std::move(text)), mColor(std::move(color)){
|
||||
mValue = value;
|
||||
Tick(QString text, QColor color, double value) : text(std::move(text)), color(std::move(color)){
|
||||
value = value;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class ProgressBar : public QWidget {
|
||||
class Progress_Bar : public QWidget {
|
||||
public:
|
||||
explicit ProgressBar(const QVector<Tick>& tickList, QWidget *parent = nullptr);
|
||||
double mTickSpaceW = 1;
|
||||
double mValue = 0;
|
||||
int mTimer;
|
||||
std::function<void(void)> mSetValue = nullptr;
|
||||
double getDrawWidth(double value);
|
||||
explicit Progress_Bar(const QVector<Tick>& tick_list, QWidget *parent = nullptr);
|
||||
double tick_space_w = 1;
|
||||
double value = 0;
|
||||
int timer;
|
||||
std::function<void(void)> set_value = nullptr;
|
||||
double get_draw_width(double value);
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event) override;
|
||||
void timerEvent(QTimerEvent *event) override;
|
||||
QVector<Tick> mTickList;
|
||||
QVector<Tick> tick_list;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user