feat: added data model and ui for main window

This commit is contained in:
2026-01-17 14:08:34 +03:00
parent eb4b3557fa
commit f6ec31183a
19 changed files with 273 additions and 7 deletions

View File

@@ -1,8 +1,50 @@
#ifndef LICENSEMANAGER_LICENSEMODEL_H
#define LICENSEMANAGER_LICENSEMODEL_H
#include <QAbstractTableModel>
class LicenseModel {};
class LicenseModel : public QAbstractTableModel
{
Q_OBJECT
public:
enum class Status
{
None = 0,
Ok,
DbStructError,
DbExistError,
};
struct LicenseItem
{
QString id;
QString city;
QString email;
QString firstName;
QString hardwareHash;
QString lastName;
QString patronymic;
QString phone;
QString yourCompany;
QString comment;
};
explicit LicenseModel(QObject* parent = nullptr);
~LicenseModel();
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
Status getStatus();
QString getStatusText();
private:
QList<LicenseItem> m_data;
QStringList m_errors;
};
#endif // LICENSEMANAGER_LICENSEMODEL_H