summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkh1 <qt-info@nokia.com>2010-08-23 14:30:29 +0200
committerhjk <qtc-committer@nokia.com>2010-08-23 15:29:43 +0200
commit3e06ffd0c9085d8c64e2bf10a2f4a12ed1f09d9d (patch)
tree24360fc9e590cac32b95a12778eecae93dfbe66a
parent7dfcbe5f3998916c005671d23c1fb54aaedb0bbc (diff)
downloadqt-creator-3e06ffd0c9085d8c64e2bf10a2f4a12ed1f09d9d.tar.gz
Fix jumping to an anchor once the page has been scrolled.
Task-number: QTCREATORBUG-2130 (cherry picked from commit 9e352be3b1698ee3607ca9c6760a82340d8b50b8)
-rw-r--r--src/plugins/help/helpplugin.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp
index e8c733b0f7..9c7beb8682 100644
--- a/src/plugins/help/helpplugin.cpp
+++ b/src/plugins/help/helpplugin.cpp
@@ -719,16 +719,20 @@ void HelpPlugin::activateContext()
viewer->stop();
#endif
viewer->setSource(source);
- }
- viewer->setFocus();
- connect(viewer, SIGNAL(loadFinished(bool)), this,
- SLOT(highlightSearchTerms()));
+ connect(viewer, SIGNAL(loadFinished(bool)), this,
+ SLOT(highlightSearchTerms()));
- if (source.toString().remove(source.fragment())
- == oldSource.toString().remove(oldSource.fragment())) {
- highlightSearchTerms();
+ if (source.toString().remove(source.fragment())
+ == oldSource.toString().remove(oldSource.fragment())) {
+ highlightSearchTerms();
+ }
+ } else {
+#if !defined(QT_NO_WEBKIT)
+ viewer->page()->mainFrame()->scrollToAnchor(source.fragment());
+#endif
}
}
+ viewer->setFocus();
}
}
@@ -866,7 +870,7 @@ void HelpPlugin::highlightSearchTerms()
if (attrValue == name || name.startsWith(attrValue + QLatin1Char('-'))) {
QWebElement parent = element.parent();
m_styleProperty = parent.styleProperty(property,
- QWebElement::InlineStyle);
+ QWebElement::ComputedStyle);
parent.setStyleProperty(property, QLatin1String("yellow"));
}
}