25 : QAbstractItemModel( parent )
27 , mAllowExpression( false )
33 QString fldName( fieldName );
41 if ( !fieldNameWithAlias.isNull() )
42 fldName = fieldNameWithAlias;
46 QModelIndex idx =
index( r, 0 );
75 disconnect(
mLayer, SIGNAL( layerDeleted() ),
this, SLOT( layerDeleted() ) );
87 connect(
mLayer, SIGNAL( layerDeleted() ),
this, SLOT( layerDeleted() ) );
91 void QgsFieldModel::layerDeleted()
135 for (
int i = 0; i < newFields.
count(); ++i )
145 beginRemoveRows( QModelIndex(), i, i );
180 beginRemoveRows( QModelIndex(), start, end );
197 if ( !expression.isEmpty() )
211 if ( hasIndex( row, column, parent ) )
213 return createIndex( row, column, row );
216 return QModelIndex();
222 return QModelIndex();
227 if ( parent.isValid() )
243 if ( !index.isValid() )
303 return (
int )field.
type();
308 case Qt::DisplayRole:
315 else if ( role == Qt::EditRole )
317 return mFields[index.row()].name();
327 case Qt::ForegroundRole:
336 return QBrush( QColor( Qt::red ) );
347 QFont font = QFont();
348 font.setItalic(
true );