Skip to content

Commit

Permalink
[locator] Fix presence of html tag for multi-line tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Nov 29, 2018
1 parent 063d02c commit da35786
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/app/locator/qgsinbuiltlocatorfilters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() )
{
Expand All @@ -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() )
{
Expand Down

0 comments on commit da35786

Please sign in to comment.