Show wrap indicator also for searches in help views.

Task-number: QTCREATORBUG-2753
This commit is contained in:
con
2011-01-14 11:19:57 +01:00
parent ebb9e25277
commit 7915ce6bd3
6 changed files with 36 additions and 12 deletions

View File

@@ -344,17 +344,25 @@ bool HelpViewer::isBackwardAvailable() const
}
bool HelpViewer::findText(const QString &text, Find::FindFlags flags,
bool incremental, bool fromSearch)
bool incremental, bool fromSearch, bool *wrapped)
{
Q_UNUSED(incremental);
Q_UNUSED(fromSearch);
QWebPage::FindFlags options = QWebPage::FindWrapsAroundDocument;
if (wrapped)
*wrapped = false;
QWebPage::FindFlags options;
if (flags & Find::FindBackward)
options |= QWebPage::FindBackward;
if (flags & Find::FindCaseSensitively)
options |= QWebPage::FindCaseSensitively;
bool found = QWebView::findText(text, options);
if (!found) {
options |= QWebPage::FindWrapsAroundDocument;
found = QWebView::findText(text, options);
if (found && wrapped)
*wrapped = true;
}
options = QWebPage::HighlightAllOccurrences;
QWebView::findText(QLatin1String(""), options); // clear first
QWebView::findText(text, options); // force highlighting of all other matches