CrudTab uses new PgLabItemDelegate, no need anymore for CrudModel to inherit BaseTableModel.
This commit is contained in:
parent
208883462c
commit
a543ccb021
3 changed files with 60 additions and 14 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue