-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathnavigationprogressbar.h
More file actions
76 lines (58 loc) · 2.17 KB
/
navigationprogressbar.h
File metadata and controls
76 lines (58 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#pragma once
#include <QWidget>
class NavigationProgressBar : public QWidget
{
Q_OBJECT
Q_PROPERTY(QStringList messageList READ messageList WRITE setMessageList)
Q_PROPERTY(int step READ step WRITE setStep)
Q_PROPERTY(int maxStep READ maxStep)
Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor)
Q_PROPERTY(
QColor currentBackgroundColor READ currentBackgroundColor WRITE setCurrentBackgroundColor)
Q_PROPERTY(QColor foregroundColor READ foregroundColor WRITE setForegroundColor)
Q_PROPERTY(QFont textFont READ textFont WRITE setTextFont)
Q_PROPERTY(QFont dateFont READ dateFont WRITE setDateFont)
Q_PROPERTY(int spacing READ spacing WRITE setSpacing)
public:
explicit NavigationProgressBar(QWidget *parent = nullptr);
~NavigationProgressBar() override;
QSize minimumSizeHint() const override;
void setMessageList(const QStringList &list);
QStringList messageList() const;
void setStep(int step);
int step() const;
int maxStep() const;
void setBackgroundColor(const QColor &color);
QColor backgroundColor() const;
void setCurrentBackgroundColor(const QColor &color);
QColor currentBackgroundColor() const;
void setForegroundColor(const QColor &color);
QColor foregroundColor() const;
void setTextFont(const QFont &font);
QFont textFont() const;
void setDateFont(const QFont &font);
QFont dateFont() const;
void setSpacing(int spacing);
int spacing() const;
QString dateAt(int step) const;
void setDateAt(int step, const QString &date);
public slots:
void reset();
void next();
void previous();
signals:
void stepChanged(int step);
void progressCompleted();
protected:
void paintEvent(QPaintEvent *event) override;
void resizeEvent(QResizeEvent *event) override;
private:
void drawCompleteProgress(QPainter *painter);
void drawBackground(QPainter *painter, bool completed);
void drawText(QPainter *painter, bool completed);
void rebuildDateList();
void invalidateCache();
void rebuildCache();
class NavigationProgressBarPrivate;
QScopedPointer<NavigationProgressBarPrivate> d_ptr;
};