2017-12-09 10:45:13 +01:00
|
|
|
|
#include "BaseTableModel.h"
|
2021-03-31 16:06:45 +02:00
|
|
|
|
#include "CustomDataRole.h"
|
2017-12-09 10:45:13 +01:00
|
|
|
|
#include "ResultTableModelUtil.h"
|
|
|
|
|
|
#include <QBrush>
|
2018-09-09 18:52:32 +02:00
|
|
|
|
#include "Pgsql_oids.h"
|
2017-12-09 10:45:13 +01:00
|
|
|
|
|
|
|
|
|
|
using namespace Pgsql;
|
|
|
|
|
|
|
|
|
|
|
|
QVariant BaseTableModel::data(const QModelIndex &index, int role) const
|
|
|
|
|
|
{
|
|
|
|
|
|
QVariant v;
|
|
|
|
|
|
Oid oid = getType(index.column());
|
|
|
|
|
|
if (role == Qt::DisplayRole) {
|
|
|
|
|
|
v = getData(index);
|
|
|
|
|
|
}
|
2021-03-31 16:06:45 +02:00
|
|
|
|
else if (role == CustomDataTypeRole) {
|
|
|
|
|
|
v = oid;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (role == CustomDataMeaningRole) {
|
|
|
|
|
|
v = getDataMeaning(index);
|
|
|
|
|
|
}
|
|
|
|
|
|
return v;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-04-01 14:58:42 +02:00
|
|
|
|
QVariant BaseTableModel::getDataMeaning(const QModelIndex &) const
|
2021-03-31 16:06:45 +02:00
|
|
|
|
{
|
|
|
|
|
|
return static_cast<int>(DataMeaningNormal);
|
2017-12-09 10:45:13 +01:00
|
|
|
|
}
|