Skip to content

Commit 2bd39e2

Browse files
committedMay 27, 2015
Fix crash if multiple multiline text edtit widgets for the same field are shown
Fix #11813
1 parent 8eca38c commit 2bd39e2

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed
 

‎src/gui/editorwidgets/qgstexteditwrapper.cpp

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,27 +130,33 @@ void QgsTextEditWrapper::initWidget( QWidget* editor )
130130
}
131131
}
132132

133-
void QgsTextEditWrapper::setValue( const QVariant& value )
133+
void QgsTextEditWrapper::setValue( const QVariant& val )
134134
{
135135
QString v;
136-
if ( value.isNull() )
136+
if ( val.isNull() )
137137
{
138138
if ( !( field().type() == QVariant::Int || field().type() == QVariant::Double || field().type() == QVariant::LongLong || field().type() == QVariant::Date ) )
139139
v = QSettings().value( "qgis/nullValue", "NULL" ).toString();
140140
}
141141
else
142-
v = value.toString();
142+
v = val.toString();
143143

144144
if ( mTextEdit )
145145
{
146-
if ( config( "UseHtml" ).toBool() )
147-
mTextEdit->setHtml( v );
148-
else
149-
mTextEdit->setPlainText( v );
146+
if ( val != value() )
147+
{
148+
if ( config( "UseHtml" ).toBool() )
149+
mTextEdit->setHtml( v );
150+
else
151+
mTextEdit->setPlainText( v );
152+
}
150153
}
151154

152155
if ( mPlainTextEdit )
153-
mPlainTextEdit->setPlainText( v );
156+
{
157+
if ( val != value() )
158+
mPlainTextEdit->setPlainText( v );
159+
}
154160

155161
if ( mLineEdit )
156162
mLineEdit->setText( v );

0 commit comments

Comments
 (0)
Please sign in to comment.