Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
card_database_update_status_bar.h
Go to the documentation of this file.
1#ifndef CARD_DATABASE_UPDATE_STATUS_BAR_H
2#define CARD_DATABASE_UPDATE_STATUS_BAR_H
3
5
6#include <QString>
7#include <QWidget>
8#include <qtmetamacros.h>
9
10class QEvent;
11class QHBoxLayout;
12class QLabel;
13class QProgressBar;
14
23class CardDatabaseUpdateStatusBar : public QWidget
24{
25 Q_OBJECT
26public:
31 explicit CardDatabaseUpdateStatusBar(QWidget *parent = nullptr);
32
37 QString statusText() const;
38
39public slots:
43 void updateStarted();
44
49
53 void updateFinished();
54
55protected:
56 void changeEvent(QEvent *event) override;
57
58private:
59 void refresh();
60
61 QHBoxLayout *layout;
62 QLabel *stageLabel;
63 QProgressBar *progressBar;
65 bool active = false;
66};
67
68#endif // CARD_DATABASE_UPDATE_STATUS_BAR_H
CardUpdateProgress progress
Last reported progress.
Definition card_database_update_status_bar.h:64
QHBoxLayout * layout
Horizontal layout holding the stage label and the progress bar.
Definition card_database_update_status_bar.h:61
bool active
Whether an update is currently running.
Definition card_database_update_status_bar.h:65
QLabel * stageLabel
Name of the stage currently running.
Definition card_database_update_status_bar.h:62
QString statusText() const
Human readable description of the running stage, e.g. "Downloading (42%)".
Definition card_database_update_status_bar.cpp:50
void changeEvent(QEvent *event) override
Definition card_database_update_status_bar.cpp:86
void updateProgress(const CardUpdateProgress &progress)
Shows the progress of one update stage.
Definition card_database_update_status_bar.cpp:71
CardDatabaseUpdateStatusBar(QWidget *parent=nullptr)
Constructs a hidden progress widget.
Definition card_database_update_status_bar.cpp:33
void updateFinished()
Hides the widget and clears the reported progress.
Definition card_database_update_status_bar.cpp:78
void refresh()
Definition card_database_update_status_bar.cpp:94
QProgressBar * progressBar
Progress within the current stage.
Definition card_database_update_status_bar.h:63
void updateStarted()
Shows the widget and resets it to the indeterminate state.
Definition card_database_update_status_bar.cpp:63
One progress line read from the card database updater's stdout.
Definition card_update_progress.h:24