Skip to content

Commit

Permalink
Support for NaN in text edit widget
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Dec 5, 2019
1 parent 2b66b3d commit d00520a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gui/editorwidgets/qgstexteditwrapper.cpp
Expand Up @@ -228,10 +228,10 @@ void QgsTextEditWrapper::setWidgetValue( const QVariant &val )
if ( !( field().type() == QVariant::Int || field().type() == QVariant::Double || field().type() == QVariant::LongLong || field().type() == QVariant::Date ) )
v = QgsApplication::nullRepresentation();
}
else if ( val.type() == QVariant::Double && std::isnan( val.toDouble() ) )
v = QgsApplication::nullRepresentation();
else
{
v = field().displayString( val );
}

// For numbers, remove the group separator that might cause validation errors
// when the user is editing the field value.
Expand Down

0 comments on commit d00520a

Please sign in to comment.