File tree 2 files changed +26
-6
lines changed
2 files changed +26
-6
lines changed Original file line number Diff line number Diff line change @@ -627,12 +627,16 @@ void QgsAttributeTableDialog::search()
627
627
int fldIndex = mLayer ->fieldNameIndex ( fieldName );
628
628
QVariant::Type fldType = flds[fldIndex].type ();
629
629
bool numeric = ( fldType == QVariant::Int || fldType == QVariant::Double );
630
+ QString sensString = " ILIKE" ;
631
+ if (cbxCaseSensitive->isChecked ()) {
632
+ sensString = " LIKE" ;
633
+ }
630
634
631
635
QString str = QString ( " %1 %2 '%3'" )
632
636
.arg ( QgsSearchTreeNode::quotedColumnRef ( fieldName ) )
633
- .arg ( numeric ? " =" : " ~ " )
634
- .arg ( mQuery ->displayText ().replace ( " '" , " ''" ) ); // escape quotes
635
-
637
+ .arg ( numeric ? " =" : sensString )
638
+ .arg ( numeric ? mQuery ->displayText ().replace ( " '" , " ''" ) :
639
+ " % " + mQuery -> displayText (). replace ( " ' " , " '' " ) + " % " ); // escape quotes
636
640
doSearch ( str );
637
641
}
638
642
Original file line number Diff line number Diff line change 26
26
<item >
27
27
<widget class =" QCheckBox" name =" cbxShowSelectedOnly" >
28
28
<property name =" text" >
29
- <string >Show selected records only</string >
29
+ <string >Show selected only</string >
30
30
</property >
31
31
</widget >
32
32
</item >
33
33
<item >
34
34
<widget class =" QCheckBox" name =" cbxSearchSelectedOnly" >
35
35
<property name =" text" >
36
- <string >Search selected records only</string >
36
+ <string >Search selected only</string >
37
+ </property >
38
+ </widget >
39
+ </item >
40
+ <item >
41
+ <widget class =" QCheckBox" name =" cbxCaseSensitive" >
42
+ <property name =" text" >
43
+ <string >Case sensitive</string >
44
+ </property >
45
+ <property name =" checked" >
46
+ <bool >true</bool >
37
47
</property >
38
48
</widget >
39
49
</item >
68
78
</item >
69
79
<item >
70
80
<widget class =" QPushButton" name =" mHelpButton" >
81
+ <property name =" minimumSize" >
82
+ <size >
83
+ <width >85</width >
84
+ <height >0</height >
85
+ </size >
86
+ </property >
71
87
<property name =" text" >
72
- <string >Help </string >
88
+ <string >? </string >
73
89
</property >
74
90
</widget >
75
91
</item >
You can’t perform that action at this time.
0 commit comments