git-svn-id: http://svn.osgeo.org/qgis/trunk@14183 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
jef 2010-09-02 16:15:25 +00:00
parent c593facc90
commit fe9b709668
2 changed files with 14 additions and 5 deletions

View File

@ -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;

View File

@ -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 );