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,5 +1,81 @@
//
// Created by debian on 1/16/26.
//
#include "LicenseModel.h"
const static int COLUMN_COUNT = 9;
LicenseModel::LicenseModel(QObject* parent)
: QAbstractTableModel(parent)
{
}
LicenseModel::~LicenseModel()
{
}
int LicenseModel::rowCount(const QModelIndex &parent) const
{
return 0;
}
int LicenseModel::columnCount(const QModelIndex &parent) const
{
return COLUMN_COUNT;
}
QVariant LicenseModel::data(const QModelIndex &index, int role) const
{
switch (role)
{
case Qt::DisplayRole:
break;
case Qt::ToolTipRole:
return {}; // TODO: return client id
default:
return {};
}
return {};
}
QVariant LicenseModel::headerData(int section, Qt::Orientation orientation, int role) const
{
if (role != Qt::DisplayRole)
return {};
if (orientation == Qt::Vertical)
return QString::number(section + 1);
switch (section)
{
case 0:
return tr("Last name");
case 1:
return tr("First name");
case 2:
return tr("Patronymic");
case 3:
return tr("Email");
case 4:
return tr("Phone number");
case 5:
return tr("Company");
case 6:
return tr("City");
case 7:
return tr("Created date");
case 8:
return tr("Comment");
default:
return {};
}
}
LicenseModel::Status LicenseModel::getStatus()
{
}
QString LicenseModel::getStatusText()
{
}