Skip to content
Permalink
Browse files

field model: return alias as display role, but field name as edit role (

fixes #10467)
  • Loading branch information
jef-n committed Jun 9, 2014
1 parent 45e712f commit 277d126816049dd9f349ff2285b1db82cc2c2b1b
Showing with 9 additions and 1 deletion.
  1. +9 −1 src/gui/qgsfieldmodel.cpp
@@ -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:
@@ -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:

0 comments on commit 277d126

Please sign in to comment.
You can’t perform that action at this time.