Skip to content
Permalink
Browse files

[locator] Fix presence of html tag for multi-line tooltips

  • Loading branch information
nirvn committed Nov 28, 2018
1 parent 063d02c commit da35786318dd5a6dd36540c03032508f01ffdfb3
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/app/locator/qgsinbuiltlocatorfilters.cpp
@@ -146,6 +146,7 @@ void QgsActionLocatorFilter::searchActions( const QString &string, QWidget *pare
}

QRegularExpression extractFromTooltip( QStringLiteral( "<b>(.*)</b>" ) );
QRegularExpression newLineToSpace( QStringLiteral( "[\\s\\n\\r]+" ) );

Q_FOREACH ( QAction *action, parent->actions() )
{
@@ -164,6 +165,7 @@ void QgsActionLocatorFilter::searchActions( const QString &string, QWidget *pare
searchText.replace( '&', QString() );

QString tooltip = action->toolTip();
tooltip.replace( newLineToSpace, QStringLiteral( " " ) );
QRegularExpressionMatch match = extractFromTooltip.match( tooltip );
if ( match.hasMatch() )
{

0 comments on commit da35786

Please sign in to comment.
You can’t perform that action at this time.