Reorganization of pgLab project
This commit is contained in:
parent
7300865c77
commit
c71fdc4af7
78 changed files with 204 additions and 148 deletions
28
pglab/catalog/models/BaseTableModel.cpp
Normal file
28
pglab/catalog/models/BaseTableModel.cpp
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#include "BaseTableModel.h"
|
||||
#include "CustomDataRole.h"
|
||||
#include "ResultTableModelUtil.h"
|
||||
#include <QBrush>
|
||||
#include "Pgsql_oids.h"
|
||||
|
||||
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);
|
||||
}
|
||||
else if (role == CustomDataTypeRole) {
|
||||
v = oid;
|
||||
}
|
||||
else if (role == CustomDataMeaningRole) {
|
||||
v = getDataMeaning(index);
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
QVariant BaseTableModel::getDataMeaning(const QModelIndex &) const
|
||||
{
|
||||
return static_cast<int>(DataMeaningNormal);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue