diff --git a/src/app/qgsattributedialog.cpp b/src/app/qgsattributedialog.cpp index a5390e8ed89..0cce2e711e0 100644 --- a/src/app/qgsattributedialog.cpp +++ b/src/app/qgsattributedialog.cpp @@ -156,7 +156,10 @@ QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeat mypLabel->setText( myFieldName + tr( " (txt)" ) ); } - myWidget->setEnabled( vl->isEditable() ); + if ( vl->editType( it.key() ) != QgsVectorLayer::Immutable ) + { + myWidget->setEnabled( vl->isEditable() ); + } mypInnerLayout->addWidget( myWidget, index, 1 ); mpIndizes << it.key(); @@ -181,7 +184,10 @@ QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeat QgsAttributeEditor::createAttributeEditor( mDialog, myWidget, vl, it.key(), it.value() ); - myWidget->setEnabled( vl->isEditable() ); + if ( vl->editType( it.key() ) != QgsVectorLayer::Immutable ) + { + myWidget->setEnabled( vl->isEditable() ); + } mpIndizes << it.key(); mpWidgets << myWidget; diff --git a/src/gui/qgsattributeeditor.cpp b/src/gui/qgsattributeeditor.cpp index defe7f6c675..5971877ff36 100644 --- a/src/gui/qgsattributeeditor.cpp +++ b/src/gui/qgsattributeeditor.cpp @@ -318,6 +318,7 @@ QWidget *QgsAttributeEditor::createAttributeEditor( QWidget *parent, QWidget *ed case QgsVectorLayer::LineEdit: case QgsVectorLayer::TextEdit: case QgsVectorLayer::UniqueValuesEditable: + case QgsVectorLayer::Immutable: { QLineEdit *le = NULL; QTextEdit *te = NULL; @@ -381,6 +382,11 @@ QWidget *QgsAttributeEditor::createAttributeEditor( QWidget *parent, QWidget *ed { myWidget = pte; } + + if ( myWidget ) + { + myWidget->setDisabled( editType == QgsVectorLayer::Immutable ); + } } break; @@ -428,9 +434,6 @@ QWidget *QgsAttributeEditor::createAttributeEditor( QWidget *parent, QWidget *ed } } break; - - case QgsVectorLayer::Immutable: - return NULL; } setValue( myWidget, vl, idx, value );