35 #include <QHelpEngine>
39 #include <QDesktopServices>
44 : QTextBrowser(parent), mEngine(engine)
46 connect(mEngine.get(), SIGNAL(keywordActivated(QString)),
this, SLOT(
showHelpForKeyword(
const QString&)));
52 if (mEngine->engine())
54 QMap<QString, QUrl> links = mEngine->engine()->linksForIdentifier(
id);
72 if (name.scheme() ==
"qthelp")
73 QTextBrowser::setSource(name);
76 QDesktopServices::openUrl(name);
81 QVariant HelpBrowser::loadResource(
int type,
const QUrl &name)
83 if (type < 4 && mEngine->engine())
86 if (name.isRelative())
87 url = source().resolved(url);
91 if (url.scheme() ==
"qthelp")
92 return QVariant(mEngine->engine()->fileData(url));
94 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)