Skip to content
Permalink
Browse files

attribute form: lookup attribute fields by name. joined layers might …

…be unavailable at load time (fixes #12146)
  • Loading branch information
jef-n committed Feb 22, 2015
1 parent 789435d commit 61555f59125ba6b416cd166b955a09401ef6469d
Showing with 3 additions and 3 deletions.
  1. +2 −2 src/core/qgsvectorlayer.cpp
  2. +1 −1 src/gui/qgsattributeform.cpp
@@ -1758,7 +1758,7 @@ QgsAttributeEditorElement* QgsVectorLayer::attributeEditorElementFromDomElement(
for ( int i = 0; i < childNodeList.size(); i++ )
{
QDomElement childElem = childNodeList.at( i ).toElement();
QgsAttributeEditorElement* myElem = attributeEditorElementFromDomElement( childElem, container );
QgsAttributeEditorElement *myElem = attributeEditorElementFromDomElement( childElem, container );
if ( myElem )
container->addChildElement( myElem );
}
@@ -1768,7 +1768,7 @@ QgsAttributeEditorElement* QgsVectorLayer::attributeEditorElementFromDomElement(
else if ( elem.tagName() == "attributeEditorField" )
{
QString name = elem.attribute( "name" );
int idx = *( dataProvider()->fieldNameMap() ).find( name );
int idx = fieldNameIndex( name );
newElement = new QgsAttributeEditorField( name, idx, parent );
}
else if ( elem.tagName() == "attributeEditorRelation" )
@@ -571,7 +571,7 @@ QWidget* QgsAttributeForm::createWidgetFromDef( const QgsAttributeEditorElement
if ( !fieldDef )
break;

int fldIdx = fieldDef->idx();
int fldIdx = vl->fieldNameIndex( fieldDef->name() );
if ( fldIdx < vl->pendingFields().count() && fldIdx >= 0 )
{
const QString widgetType = mLayer->editorWidgetV2( fldIdx );

0 comments on commit 61555f5

Please sign in to comment.
You can’t perform that action at this time.