35 #include <QHelpEngine>
39 #include <QDesktopServices>
44 : QTextBrowser(parent), mEngine(engine)
46 connect(mEngine.get(), SIGNAL(keywordActivated(QString)),
this, SLOT(
showHelpForKeyword(
const QString&)));
51 if (mEngine->engine())
53 QMap<QString, QUrl> links = mEngine->engine()->linksForIdentifier(
id);
63 if (name.scheme() ==
"qthelp")
64 QTextBrowser::setSource(name);
67 QDesktopServices::openUrl(name);
72 QVariant HelpBrowser::loadResource(
int type,
const QUrl &name)
74 if (type < 4 && mEngine->engine())
77 if (name.isRelative())
78 url = source().resolved(url);
80 if (url.scheme() ==
"qthelp")
81 return QVariant(mEngine->engine()->fileData(url));
83 return QTextBrowser::loadResource(type, url);
void showHelpForKeyword(const QString &id)
virtual void setSource(const QUrl &name)
boost::shared_ptr< HelpEngine > HelpEnginePtr
HelpBrowser(QWidget *parent, HelpEnginePtr engine)