2026-07-03 14:19:06 +08:00

44 lines
1.2 KiB
C++

#ifndef DRONESCREWCTRL_DIALOG_HISTORY_RESULT_H
#define DRONESCREWCTRL_DIALOG_HISTORY_RESULT_H
#include <QDialog>
#include <QString>
#include <QStringList>
namespace Ui { class DialogHistoryResult; }
class QFileInfo;
class QModelIndex;
class QStringListModel;
class DialogHistoryResult : public QDialog
{
Q_OBJECT
public:
explicit DialogHistoryResult(const QString& historyDir, QWidget* parent = nullptr);
~DialogHistoryResult() override;
void SetHistoryDir(const QString& historyDir);
private slots:
void on_btn_refresh_clicked();
void on_btn_close_clicked();
private:
void reloadHistory();
void showRecord(int row);
void onHistoryCurrentChanged(const QModelIndex& current, const QModelIndex& previous);
QString readHistoryFile(const QString& filePath) const;
QString makeItemTitle(const QFileInfo& fileInfo, const QString& content) const;
QString fieldValue(const QString& content, const QString& fieldName) const;
private:
Ui::DialogHistoryResult* ui{nullptr};
QStringListModel* m_listModel{nullptr};
QString m_historyDir;
QStringList m_filePaths;
};
#endif // DRONESCREWCTRL_DIALOG_HISTORY_RESULT_H