minor
This commit is contained in:
@@ -45,13 +45,14 @@ LicenseModel::~LicenseModel()
|
||||
|
||||
int LicenseModel::rowCount(const QModelIndex &parent) const
|
||||
{
|
||||
return 0;
|
||||
return m_data.size();
|
||||
}
|
||||
|
||||
int LicenseModel::columnCount(const QModelIndex &parent) const
|
||||
{
|
||||
return COLUMN_COUNT;
|
||||
}
|
||||
|
||||
QVariant LicenseModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
switch (role)
|
||||
@@ -147,3 +148,18 @@ bool LicenseModel::prepareDatabase()
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void LicenseModel::addClient(const LicenseItem &item)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void LicenseModel::deleteClient(const LicenseItem &item)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void LicenseModel::editClient(const LicenseItem &item)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef LICENSEMANAGER_LICENSEMODEL_H
|
||||
#define LICENSEMANAGER_LICENSEMODEL_H
|
||||
|
||||
// Qt
|
||||
#include <QAbstractTableModel>
|
||||
#include <QtSql/QSqlDatabase>
|
||||
|
||||
@@ -38,15 +39,14 @@ public:
|
||||
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();
|
||||
|
||||
bool prepareDatabase();
|
||||
|
||||
void addClient(const LicenseItem &item);
|
||||
void deleteClient(const LicenseItem &item);
|
||||
void editClient(const LicenseItem &item);
|
||||
private:
|
||||
bool checkTables();
|
||||
|
||||
private:
|
||||
QList<LicenseItem> m_data;
|
||||
Status m_status = Status::None;
|
||||
@@ -54,5 +54,4 @@ private:
|
||||
QSqlDatabase m_db;
|
||||
};
|
||||
|
||||
|
||||
#endif // LICENSEMANAGER_LICENSEMODEL_H
|
||||
|
||||
Reference in New Issue
Block a user