This commit is contained in:
2026-01-18 01:52:58 +03:00
parent 60090062dc
commit 46504c1b06
2 changed files with 21 additions and 6 deletions

View File

@@ -45,13 +45,14 @@ LicenseModel::~LicenseModel()
int LicenseModel::rowCount(const QModelIndex &parent) const int LicenseModel::rowCount(const QModelIndex &parent) const
{ {
return 0; return m_data.size();
} }
int LicenseModel::columnCount(const QModelIndex &parent) const int LicenseModel::columnCount(const QModelIndex &parent) const
{ {
return COLUMN_COUNT; return COLUMN_COUNT;
} }
QVariant LicenseModel::data(const QModelIndex &index, int role) const QVariant LicenseModel::data(const QModelIndex &index, int role) const
{ {
switch (role) switch (role)
@@ -147,3 +148,18 @@ bool LicenseModel::prepareDatabase()
return true; return true;
} }
void LicenseModel::addClient(const LicenseItem &item)
{
}
void LicenseModel::deleteClient(const LicenseItem &item)
{
}
void LicenseModel::editClient(const LicenseItem &item)
{
}

View File

@@ -1,6 +1,7 @@
#ifndef LICENSEMANAGER_LICENSEMODEL_H #ifndef LICENSEMANAGER_LICENSEMODEL_H
#define LICENSEMANAGER_LICENSEMODEL_H #define LICENSEMANAGER_LICENSEMODEL_H
// Qt
#include <QAbstractTableModel> #include <QAbstractTableModel>
#include <QtSql/QSqlDatabase> #include <QtSql/QSqlDatabase>
@@ -38,15 +39,14 @@ public:
int columnCount(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 data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
Status getStatus(); Status getStatus();
QString getStatusText(); QString getStatusText();
bool prepareDatabase(); bool prepareDatabase();
void addClient(const LicenseItem &item);
void deleteClient(const LicenseItem &item);
void editClient(const LicenseItem &item);
private: private:
bool checkTables(); bool checkTables();
private: private:
QList<LicenseItem> m_data; QList<LicenseItem> m_data;
Status m_status = Status::None; Status m_status = Status::None;
@@ -54,5 +54,4 @@ private:
QSqlDatabase m_db; QSqlDatabase m_db;
}; };
#endif // LICENSEMANAGER_LICENSEMODEL_H #endif // LICENSEMANAGER_LICENSEMODEL_H