Skip to content
Permalink
Browse files

Merge pull request #8100 from elpaso/bugfix-19388-crash-on-form-widget

Fix a crash on attribute form widget
  • Loading branch information
elpaso committed Oct 4, 2018
2 parents cc4e2ab + 6a8d80d commit 031efeb39cab0c3ce90c4805e2c42c611f5dd679
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/gui/qgsattributeform.cpp
@@ -1654,13 +1654,13 @@ QgsAttributeForm::WidgetInfo QgsAttributeForm::createWidgetFromDef( const QgsAtt
addWidgetWrapper( eww );

newWidgetInfo.widget->setObjectName( fields.at( fldIdx ).name() );
newWidgetInfo.hint = fields.at( fieldDef->idx() ).comment();
newWidgetInfo.hint = fields.at( fldIdx ).comment();
}

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

break;

0 comments on commit 031efeb

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