Files
iDescriptor/src/qprocessindicator.h
T
uncor3 e25f194ee9 Refactor app download process and integrate AppStoreManager
- Replaced the direct usage of the Go library with AppStoreManager in AppDownloadBaseDialog.
- Removed the C-style callback for download progress and implemented a lambda function for progress updates.
- Added error handling for AppStoreManager initialization in the download process.
- Updated AppDownloadDialog to use QStandardPaths for the default download directory.
- Created AppStoreManager class to handle account management and app operations.
- Implemented login functionality in LoginDialog using AppStoreManager.
- Added QProcessIndicator for visual feedback during login and app download processes.
- Updated AppsWidget to manage login state and display account information using AppStoreManager.
- Cleaned up unused code and improved UI elements for better user experience.
2025-10-02 23:02:04 +00:00

62 lines
1.3 KiB
C++

// https://github.com/raythorn/QProcessIndicator/blob/master/QProcessIndicator/QProcessIndicator.h
#ifndef QPROCESSINDICATOR_H
#define QPROCESSINDICATOR_H
#include <QColor>
#include <QPaintEvent>
#include <QPainter>
#include <QTimer>
#include <QWidget>
class QProcessIndicator : public QWidget
{
Q_OBJECT
Q_PROPERTY(int m_type READ type WRITE setType)
Q_PROPERTY(QColor m_color READ color WRITE setColor)
Q_PROPERTY(int m_interval READ interval WRITE setInterval)
public:
QProcessIndicator(QWidget *parent = 0);
~QProcessIndicator();
enum {
line_rotate,
line_scale,
ball_rotate,
};
void paintEvent(QPaintEvent *e);
void start();
void stop();
int type() { return m_type; }
void setType(int type) { m_type = type; }
QColor &color() { return m_color; }
void setColor(QColor &color) { m_color = color; }
int interval() { return m_interval; }
void setInterval(int interval) { m_interval = interval; }
private slots:
void onTimeout();
private:
void drawRotateLine(QPainter *painter);
void drawScaleLine(QPainter *painter);
void drawRotateBall(QPainter *painter);
private:
int m_type;
int m_interval;
QColor m_color;
int m_angle;
qreal m_scale;
QTimer *m_timer;
};
#endif // QPROCESSINDICATOR_H