Skip to content

Commit

Permalink
Add handling of null value in value map to search widget
Browse files Browse the repository at this point in the history
  • Loading branch information
dgoedkoop committed Jul 11, 2016
1 parent 63f9f71 commit 6b904e7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/gui/editorwidgets/qgsvaluemapsearchwidgetwrapper.cpp
Expand Up @@ -15,6 +15,7 @@

#include "qgsvaluemapsearchwidgetwrapper.h"
#include "qgstexteditconfigdlg.h"
#include "qgsvaluemapconfigdlg.h"

#include "qgsfield.h"
#include "qgsfieldvalidator.h"
Expand Down Expand Up @@ -95,6 +96,12 @@ QString QgsValueMapSearchWidgetWrapper::createExpression( QgsSearchWidgetWrapper

QString currentKey = mComboBox->itemData( mComboBox->currentIndex() ).toString();

if ( currentKey == QString( VALUEMAP_NULL_TEXT ) )
if ( flags & EqualTo )
return fieldName + " IS NULL";
if ( flags & NotEqualTo )
return fieldName + " IS NOT NULL";

switch ( fldType )
{
case QVariant::Int:
Expand Down

0 comments on commit 6b904e7

Please sign in to comment.