File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -80,10 +80,6 @@ QgsSearchWidgetWrapper::FilterFlags QgsValueMapSearchWidgetWrapper::defaultFlags
80
80
81
81
QString QgsValueMapSearchWidgetWrapper::createExpression ( QgsSearchWidgetWrapper::FilterFlags flags ) const
82
82
{
83
- // if deselect value, always pass
84
- if ( mComboBox ->currentIndex () == 0 )
85
- return QString ();
86
-
87
83
// clear any unsupported flags
88
84
flags &= supportedFlags ();
89
85
@@ -95,6 +91,10 @@ QString QgsValueMapSearchWidgetWrapper::createExpression( QgsSearchWidgetWrapper
95
91
if ( flags & IsNotNull )
96
92
return fieldName + " IS NOT NULL" ;
97
93
94
+ // if deselect value, always pass
95
+ if ( mComboBox ->currentIndex () == 0 )
96
+ return QString ();
97
+
98
98
QString currentKey = mComboBox ->currentData ().toString ();
99
99
100
100
switch ( fldType )
Original file line number Diff line number Diff line change @@ -142,8 +142,8 @@ def testCreateExpression(self):
142
142
# first, set it to the "select value" item
143
143
c .setCurrentIndex (0 )
144
144
145
- self .assertEqual (w .createExpression (QgsSearchWidgetWrapper .IsNull ), '' )
146
- self .assertEqual (w .createExpression (QgsSearchWidgetWrapper .IsNotNull ), '' )
145
+ self .assertEqual (w .createExpression (QgsSearchWidgetWrapper .IsNull ), '"fldtxt" IS NULL ' )
146
+ self .assertEqual (w .createExpression (QgsSearchWidgetWrapper .IsNotNull ), '"fldtxt" IS NOT NULL ' )
147
147
self .assertEqual (w .createExpression (QgsSearchWidgetWrapper .EqualTo ), '' )
148
148
self .assertEqual (w .createExpression (QgsSearchWidgetWrapper .NotEqualTo ), '' )
149
149
You can’t perform that action at this time.
0 commit comments