Skip to content

Commit a4fc1ba

Browse files
committedApr 4, 2014
added missing roles in field model data
1 parent 8b06a16 commit a4fc1ba

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
 

‎src/gui/qgsfieldmodel.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,17 @@ QVariant QgsFieldModel::data( const QModelIndex &index, int role ) const
107107
if ( !mLayer )
108108
return QVariant();
109109

110+
if ( role == FieldNameRole )
111+
{
112+
QgsField field = mFields[index.internalId()];
113+
return field.name();
114+
}
115+
116+
if ( role == FieldIndexRole )
117+
{
118+
return index.row();
119+
}
120+
110121
if ( role == Qt::DisplayRole )
111122
{
112123
QgsField field = mFields[index.internalId()];

0 commit comments

Comments
 (0)
Please sign in to comment.