Skip to content

Commit 031efeb

Browse files
authored
Merge pull request #8100 from elpaso/bugfix-19388-crash-on-form-widget
Fix a crash on attribute form widget
2 parents cc4e2ab + 6a8d80d commit 031efeb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/gui/qgsattributeform.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -1654,13 +1654,13 @@ QgsAttributeForm::WidgetInfo QgsAttributeForm::createWidgetFromDef( const QgsAtt
16541654
addWidgetWrapper( eww );
16551655

16561656
newWidgetInfo.widget->setObjectName( fields.at( fldIdx ).name() );
1657-
newWidgetInfo.hint = fields.at( fieldDef->idx() ).comment();
1657+
newWidgetInfo.hint = fields.at( fldIdx ).comment();
16581658
}
16591659

1660-
newWidgetInfo.labelOnTop = mLayer->editFormConfig().labelOnTop( fieldDef->idx() );
1661-
newWidgetInfo.labelText = mLayer->attributeDisplayName( fieldDef->idx() );
1660+
newWidgetInfo.labelOnTop = mLayer->editFormConfig().labelOnTop( fldIdx );
1661+
newWidgetInfo.labelText = mLayer->attributeDisplayName( fldIdx );
16621662
newWidgetInfo.labelText.replace( '&', QStringLiteral( "&&" ) ); // need to escape '&' or they'll be replace by _ in the label text
1663-
newWidgetInfo.toolTip = QStringLiteral( "<b>%1</b><p>%2</p>" ).arg( mLayer->attributeDisplayName( fieldDef->idx() ), newWidgetInfo.hint );
1663+
newWidgetInfo.toolTip = QStringLiteral( "<b>%1</b><p>%2</p>" ).arg( mLayer->attributeDisplayName( fldIdx ), newWidgetInfo.hint );
16641664
newWidgetInfo.showLabel = widgetDef->showLabel();
16651665

16661666
break;

0 commit comments

Comments
 (0)