Skip to content
Permalink
Browse files

Don't crash on QgsHtmlWidgetWrapper

Fixes #33390

(cherry picked from commit 0f70637)
  • Loading branch information
elpaso authored and nyalldawson committed Dec 13, 2019
1 parent 7d1eacc commit 4e2af7d458b15c099538484851d9ba18ad5697be
Showing with 16 additions and 13 deletions.
  1. +16 −13 src/gui/qgsattributeform.cpp
@@ -244,20 +244,23 @@ void QgsAttributeForm::changeAttribute( const QString &field, const QVariant &va
for ( QgsWidgetWrapper *ww : constMWidgets )
{
QgsEditorWidgetWrapper *eww = qobject_cast<QgsEditorWidgetWrapper *>( ww );
if ( eww && eww->field().name() == field )
{
eww->setValues( value, QVariantList() );
eww->setHint( hintText );
}
// see if the field is present in additional fields of the editor widget
int index = eww->additionalFields().indexOf( field );
if ( index >= 0 )
if ( eww )
{
QVariant mainValue = eww->value();
QVariantList additionalFieldValues = eww->additionalFieldValues();
additionalFieldValues[index] = value;
eww->setValues( mainValue, additionalFieldValues );
eww->setHint( hintText );
if ( eww->field().name() == field )
{
eww->setValues( value, QVariantList() );
eww->setHint( hintText );
}
// see if the field is present in additional fields of the editor widget
int index = eww->additionalFields().indexOf( field );
if ( index >= 0 )
{
QVariant mainValue = eww->value();
QVariantList additionalFieldValues = eww->additionalFieldValues();
additionalFieldValues[index] = value;
eww->setValues( mainValue, additionalFieldValues );
eww->setHint( hintText );
}
}
}
}

0 comments on commit 4e2af7d

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