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 f4e6d06 commit 846f79d8d58740f438ec3525b5c7d2b638f3bd13
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 846f79d

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