File tree 2 files changed +3
-3
lines changed
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -1758,7 +1758,7 @@ QgsAttributeEditorElement* QgsVectorLayer::attributeEditorElementFromDomElement(
1758
1758
for ( int i = 0 ; i < childNodeList.size (); i++ )
1759
1759
{
1760
1760
QDomElement childElem = childNodeList.at ( i ).toElement ();
1761
- QgsAttributeEditorElement* myElem = attributeEditorElementFromDomElement ( childElem, container );
1761
+ QgsAttributeEditorElement * myElem = attributeEditorElementFromDomElement ( childElem, container );
1762
1762
if ( myElem )
1763
1763
container->addChildElement ( myElem );
1764
1764
}
@@ -1768,7 +1768,7 @@ QgsAttributeEditorElement* QgsVectorLayer::attributeEditorElementFromDomElement(
1768
1768
else if ( elem.tagName () == " attributeEditorField" )
1769
1769
{
1770
1770
QString name = elem.attribute ( " name" );
1771
- int idx = *( dataProvider ()-> fieldNameMap () ). find ( name );
1771
+ int idx = fieldNameIndex ( name );
1772
1772
newElement = new QgsAttributeEditorField ( name, idx, parent );
1773
1773
}
1774
1774
else if ( elem.tagName () == " attributeEditorRelation" )
Original file line number Diff line number Diff line change @@ -571,7 +571,7 @@ QWidget* QgsAttributeForm::createWidgetFromDef( const QgsAttributeEditorElement
571
571
if ( !fieldDef )
572
572
break ;
573
573
574
- int fldIdx = fieldDef->idx ( );
574
+ int fldIdx = vl-> fieldNameIndex ( fieldDef->name () );
575
575
if ( fldIdx < vl->pendingFields ().count () && fldIdx >= 0 )
576
576
{
577
577
const QString widgetType = mLayer ->editorWidgetV2 ( fldIdx );
You can’t perform that action at this time.
0 commit comments