CrudTab uses new PgLabItemDelegate, no need anymore for CrudModel to inherit BaseTableModel.

This commit is contained in:
eelke 2018-01-15 13:30:30 +01:00
parent 208883462c
commit a543ccb021
3 changed files with 60 additions and 14 deletions

View file

@ -108,17 +108,14 @@ QVariant CrudModel::getData(const QModelIndex &index) const
QVariant CrudModel::data(const QModelIndex &index, int role) const
{
if (role == Qt::ForegroundRole) {
int rij = index.row();
int col = index.column();
if (m_roData->null(col, rij)) {
return QBrush(Qt::gray);
}
QVariant v;
if (role == Qt::EditRole || role == Qt::DisplayRole) {
v = getData(index);
}
else if (role == Qt::EditRole) {
return getData(index);
else if (role == Qt::UserRole) {
v = getType(index.column());
}
return BaseTableModel::data(index, role);
return v;
}