feat: added data model and ui for main window
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user