qt/LedOK/device/upgradeapkdialog.h

41 lines
1.0 KiB
C
Raw Normal View History

2023-04-18 14:14:46 +08:00
#ifndef UPGRADEAPKDIALOG_H
#define UPGRADEAPKDIALOG_H
2023-10-23 11:44:22 +08:00
#include "base/loqtreewidget.h"
2023-04-18 14:14:46 +08:00
#include <QDialog>
2023-10-23 11:44:22 +08:00
#include <QProgressBar>
2023-04-18 14:14:46 +08:00
2023-10-23 11:44:22 +08:00
class UpdateApkItem;
2023-04-18 14:14:46 +08:00
class UpgradeApkDialog : public QDialog {
Q_OBJECT
public:
explicit UpgradeApkDialog(QWidget *parent = nullptr);
2023-10-23 11:44:22 +08:00
void sendProgress(UpdateApkItem *item);
2023-04-18 14:14:46 +08:00
QString filePath, fileId;
protected:
virtual void keyPressEvent(QKeyEvent *ev);
2023-10-23 11:44:22 +08:00
LoQTreeWidget *table;
};
2023-04-18 14:14:46 +08:00
2024-02-21 18:08:50 +08:00
class UpdateApkItem : public TreeWidgetItem, public QObject {
2023-10-23 11:44:22 +08:00
public:
using TreeWidgetItem::TreeWidgetItem;
void setResult(QString tip, QColor color = Qt::blue) {
auto remarks = "remarks"**treeWidget();
setText(remarks, tip);
setToolTip(remarks, tip);
setForeground(remarks, color);
}
2024-03-29 15:23:12 +08:00
void OnCheckSoftVersions(int = 0);
2023-10-23 11:44:22 +08:00
void OnCheckFpgaVersions();
2023-04-18 14:14:46 +08:00
2023-10-23 11:44:22 +08:00
QLabel *fdOnline;
QProgressBar *fdProgress;
QPushButton *btnUnlock = 0;
bool isUpdating = false;
bool isLocked = true;
2023-04-18 14:14:46 +08:00
};
#endif // UpgradeApkDialog_H