Initial QT project upload

This commit is contained in:
2026-05-04 02:48:33 +08:00
commit fca1ea21d2
43 changed files with 7367 additions and 0 deletions
+53
View File
@@ -0,0 +1,53 @@
#ifndef RECORD_LIST_MODEL_H
#define RECORD_LIST_MODEL_H
#include <QAbstractListModel>
#include <QByteArray>
#include <QHash>
#include <QModelIndex>
#include <QString>
#include <QVariant>
#include <QVector>
class RecordListModel : public QAbstractListModel
{
Q_OBJECT
public:
enum Roles {
TimestampRole = Qt::UserRole + 1,
ClassIdRole,
ClassNameRole,
StudentIdRole,
NameRole,
ConfidenceRole,
ConfidenceTextRole,
StatusRole,
StatusTextRole,
SuccessRole
};
explicit RecordListModel(QObject *parent = nullptr);
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
QHash<int, QByteArray> roleNames() const override;
struct Item {
QString timestamp;
QString classId;
QString className;
QString studentId;
QString name;
double confidence = 0.0;
QString status;
bool success = false;
};
void setItems(const QVector<Item> &items);
private:
QVector<Item> m_items;
};
#endif