Skip to content
Permalink
Browse files
do not search for less than 3 letters
  • Loading branch information
3nids committed Feb 5, 2018
1 parent c6840bd commit 058d59b
Showing 1 changed file with 4 additions and 2 deletions.
@@ -207,6 +207,8 @@ void QgsOptionsDialogBase::restoreOptionsBaseUi( const QString &title )

void QgsOptionsDialogBase::searchText( const QString &text )
{
const int minimumTextLength = 3;

mSearchLineEdit->setMinimumWidth( text.isEmpty() ? 0 : 70 );

if ( !mOptStackedWidget )
@@ -219,12 +221,12 @@ void QgsOptionsDialogBase::searchText( const QString &text )
// hide all page if text has to be search, show them all otherwise
for ( int r = 0; r < mOptListWidget->count(); ++r )
{
mOptListWidget->setRowHidden( r, !text.isEmpty() );
mOptListWidget->setRowHidden( r, text.length() >= minimumTextLength );
}

for ( const QPair< QgsOptionsDialogHighlightWidget *, int > &rsw : qgis::as_const( mRegisteredSearchWidgets ) )
{
if ( rsw.first->searchHighlight( text ) )
if ( rsw.first->searchHighlight( text.length() >= minimumTextLength ? text : QString() ) )
{
mOptListWidget->setRowHidden( rsw.second, false );
}

0 comments on commit 058d59b

Please sign in to comment.