summaryrefslogtreecommitdiff
path: root/src/plugins/help/helpplugin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/help/helpplugin.cpp')
-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"));
}
}