Commit 1a1d0e26 authored by kh1's avatar kh1
Browse files

Use HighlightAllOccurrences to have highlighting during type and search.

Task-number: QTCREATORBUG-235
parent 58301f6b
......@@ -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
......
......@@ -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();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment