Skip to content

Commit fe9b709

Browse files
author
jef
committedSep 2, 2010
fix #2978
git-svn-id: http://svn.osgeo.org/qgis/trunk@14183 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent c593fac commit fe9b709

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed
 

‎src/app/qgsattributedialog.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,10 @@ QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeat
156156
mypLabel->setText( myFieldName + tr( " (txt)" ) );
157157
}
158158

159-
myWidget->setEnabled( vl->isEditable() );
159+
if ( vl->editType( it.key() ) != QgsVectorLayer::Immutable )
160+
{
161+
myWidget->setEnabled( vl->isEditable() );
162+
}
160163

161164
mypInnerLayout->addWidget( myWidget, index, 1 );
162165
mpIndizes << it.key();
@@ -181,7 +184,10 @@ QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeat
181184

182185
QgsAttributeEditor::createAttributeEditor( mDialog, myWidget, vl, it.key(), it.value() );
183186

184-
myWidget->setEnabled( vl->isEditable() );
187+
if ( vl->editType( it.key() ) != QgsVectorLayer::Immutable )
188+
{
189+
myWidget->setEnabled( vl->isEditable() );
190+
}
185191

186192
mpIndizes << it.key();
187193
mpWidgets << myWidget;

‎src/gui/qgsattributeeditor.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ QWidget *QgsAttributeEditor::createAttributeEditor( QWidget *parent, QWidget *ed
318318
case QgsVectorLayer::LineEdit:
319319
case QgsVectorLayer::TextEdit:
320320
case QgsVectorLayer::UniqueValuesEditable:
321+
case QgsVectorLayer::Immutable:
321322
{
322323
QLineEdit *le = NULL;
323324
QTextEdit *te = NULL;
@@ -381,6 +382,11 @@ QWidget *QgsAttributeEditor::createAttributeEditor( QWidget *parent, QWidget *ed
381382
{
382383
myWidget = pte;
383384
}
385+
386+
if ( myWidget )
387+
{
388+
myWidget->setDisabled( editType == QgsVectorLayer::Immutable );
389+
}
384390
}
385391
break;
386392

@@ -428,9 +434,6 @@ QWidget *QgsAttributeEditor::createAttributeEditor( QWidget *parent, QWidget *ed
428434
}
429435
}
430436
break;
431-
432-
case QgsVectorLayer::Immutable:
433-
return NULL;
434437
}
435438

436439
setValue( myWidget, vl, idx, value );

0 commit comments

Comments
 (0)
Please sign in to comment.