@@ -177,7 +177,6 @@ QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeat
177
177
// show attribute alias if available
178
178
QString myFieldName = vl->attributeDisplayName ( fldIdx );
179
179
int myFieldType = theFields[fldIdx].type ();
180
- bool isEditable = vl->fieldEditable ( fldIdx );
181
180
182
181
QWidget *myWidget = QgsAttributeEditor::createAttributeEditor ( 0 , 0 , vl, fldIdx, myAttributes[fldIdx], mProxyWidgets );
183
182
if ( !myWidget )
@@ -205,7 +204,7 @@ QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeat
205
204
206
205
if ( vl->editType ( fldIdx ) != QgsVectorLayer::Immutable )
207
206
{
208
- myWidget->setEnabled ( vl->isEditable () && isEditable );
207
+ myWidget->setEnabled ( vl->isEditable () && vl-> fieldEditable (fldIdx) );
209
208
}
210
209
211
210
mypInnerLayout->addWidget ( myWidget, index , 1 );
@@ -234,15 +233,13 @@ QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeat
234
233
if ( !myWidgets.size () )
235
234
continue ;
236
235
237
- bool isEditable = vl->fieldEditable ( fldIdx );
238
-
239
236
for ( QList<QWidget *>::const_iterator itw = myWidgets.begin (); itw != myWidgets.end (); ++itw )
240
237
{
241
238
QgsAttributeEditor::createAttributeEditor ( mDialog , *itw, vl, fldIdx, myAttributes[fldIdx], mProxyWidgets );
242
239
243
240
if ( vl->editType ( fldIdx ) != QgsVectorLayer::Immutable )
244
241
{
245
- ( *itw )->setEnabled (( *itw )->isEnabled () && vl->isEditable () && isEditable );
242
+ ( *itw )->setEnabled ( ( *itw)->isEnabled () && vl->isEditable () && vl-> fieldEditable ( fldIdx ) );
246
243
}
247
244
}
248
245
}
0 commit comments