Skip to content

Commit

Permalink
Respect field editable state in attribute form
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed May 29, 2014
1 parent 5754841 commit 872ed82
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/gui/qgsattributeform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,13 @@ void QgsAttributeForm::synchronizeEnabledState()

Q_FOREACH( QgsWidgetWrapper* ww, mWidgets )
{
ww->setEnabled( isEditable );
bool fieldEditable = true;
QgsEditorWidgetWrapper* eww = qobject_cast<QgsEditorWidgetWrapper*>( ww );
if ( eww )
{
fieldEditable = mLayer->fieldEditable( eww->fieldIdx() );
}
ww->setEnabled( isEditable && fieldEditable );
}

QPushButton* okButton = mButtonBox->button( QDialogButtonBox::Ok );
Expand Down

0 comments on commit 872ed82

Please sign in to comment.