diff --git a/src/plugins/help/centralwidget.cpp b/src/plugins/help/centralwidget.cpp index 67dbc09c6528f002e9ebd2328a021f8eeec59430..2968d885bae32a68983d819f687622189d9fa89c 100644 --- a/src/plugins/help/centralwidget.cpp +++ b/src/plugins/help/centralwidget.cpp @@ -660,7 +660,11 @@ bool CentralWidget::find(const QString &txt, QTextDocument::FindFlags findFlags, if (findFlags & QTextDocument::FindCaseSensitively) options |= QWebPage::FindCaseSensitively; - return viewer->findText(txt, options); + bool found = viewer->findText(txt, options); + options = QWebPage::HighlightAllOccurrences; + viewer->findText(QLatin1String(""), options); // clear first + viewer->findText(txt, options); // force highlighting of all other matches + return found; } return false; #else diff --git a/src/plugins/help/helpfindsupport.cpp b/src/plugins/help/helpfindsupport.cpp index bfb688db571f8f010838262d320e05ad6d12ce49..879d2f2e0f1bc3d9e544408535e5fb83ed50acbc 100644 --- a/src/plugins/help/helpfindsupport.cpp +++ b/src/plugins/help/helpfindsupport.cpp @@ -132,7 +132,11 @@ bool HelpViewerFindSupport::find(const QString &txt, Find::IFindSupport::FindFla if (findFlags & Find::IFindSupport::FindCaseSensitively) options |= QWebPage::FindCaseSensitively; - return m_viewer->findText(txt, options); + bool found = m_viewer->findText(txt, options); + options = QWebPage::HighlightAllOccurrences; + m_viewer->findText(QLatin1String(""), options); // clear first + m_viewer->findText(txt, options); // force highlighting of all other matches + return found; #else QTextCursor cursor = m_viewer->textCursor(); QTextDocument *doc = m_viewer->document();