File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -802,14 +802,18 @@ void QgsProjectionSelector::on_cbxHideDeprecated_stateChanged()
802
802
803
803
void QgsProjectionSelector::on_leSearch_textChanged ( const QString & theFilterTxt )
804
804
{
805
+ QString filterTxt = theFilterTxt;
806
+ filterTxt.replace ( QRegExp ( " \\ s+" ), " .*" );
807
+ QRegExp re ( filterTxt, Qt::CaseInsensitive );
808
+
805
809
// filter recent crs's
806
810
QTreeWidgetItemIterator itr ( lstRecent );
807
811
while ( *itr )
808
812
{
809
813
if (( *itr )->childCount () == 0 ) // it's an end node aka a projection
810
814
{
811
- if (( *itr )->text ( NAME_COLUMN ).contains ( theFilterTxt, Qt::CaseInsensitive )
812
- || ( *itr )->text ( AUTHID_COLUMN ).contains ( theFilterTxt, Qt::CaseInsensitive )
815
+ if (( *itr )->text ( NAME_COLUMN ).contains ( re )
816
+ || ( *itr )->text ( AUTHID_COLUMN ).contains ( re )
813
817
)
814
818
{
815
819
( *itr )->setHidden ( false );
@@ -839,8 +843,8 @@ void QgsProjectionSelector::on_leSearch_textChanged( const QString & theFilterTx
839
843
{
840
844
if (( *it )->childCount () == 0 ) // it's an end node aka a projection
841
845
{
842
- if (( *it )->text ( NAME_COLUMN ).contains ( theFilterTxt, Qt::CaseInsensitive )
843
- || ( *it )->text ( AUTHID_COLUMN ).contains ( theFilterTxt, Qt::CaseInsensitive )
846
+ if (( *it )->text ( NAME_COLUMN ).contains ( re )
847
+ || ( *it )->text ( AUTHID_COLUMN ).contains ( re )
844
848
)
845
849
{
846
850
( *it )->setHidden ( false );
You can’t perform that action at this time.
0 commit comments