Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 031efeb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/gui/qgsattributeform.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 031efeb

Please sign in to comment.