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