Skip to content

Commit

Permalink
field model: return alias as display role, but field name as edit role (
Browse files Browse the repository at this point in the history
fixes #10467)
  • Loading branch information
jef-n committed Jun 9, 2014
1 parent 45e712f commit 277d126
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/gui/qgsfieldmodel.cpp
Expand Up @@ -223,6 +223,7 @@ QVariant QgsFieldModel::data( const QModelIndex &index, int role ) const
QgsField field = mFields[index.internalId()];
return ( int )field.type();
}
return QVariant();
}

case Qt::DisplayRole:
Expand All @@ -232,7 +233,14 @@ QVariant QgsFieldModel::data( const QModelIndex &index, int role ) const
{
return mExpression[exprIdx];
}
return mLayer->attributeDisplayName( index.internalId() );
else if ( role == Qt::EditRole )
{
return mFields[index.internalId()].name();
}
else
{
return mLayer->attributeDisplayName( index.internalId() );
}
}

case Qt::ForegroundRole:
Expand Down

0 comments on commit 277d126

Please sign in to comment.