14 #include <QHelpEngine> 18 #include <QDesktopServices> 23 : QTextBrowser(parent), mEngine(engine)
29 if (mEngine->engine())
31 QMap<QString, QUrl> links = mEngine->engine()->linksForIdentifier(
id);
41 if (name.scheme() ==
"qthelp")
42 QTextBrowser::setSource(name);
45 QDesktopServices::openUrl(name);
52 connect(mEngine.get(), SIGNAL(keywordActivated(QString)),
this, SLOT(
showHelpForKeyword(
const QString&)));
55 QVariant HelpBrowser::loadResource(
int type,
const QUrl &name)
57 if (type < 4 && mEngine->engine())
60 if (name.isRelative())
61 url = source().resolved(url);
63 if (url.scheme() ==
"qthelp")
64 return QVariant(mEngine->engine()->fileData(url));
66 return QTextBrowser::loadResource(type, url);
void listenToEngineKeywordActivated()
void showHelpForKeyword(const QString &id)
virtual void setSource(const QUrl &name)
boost::shared_ptr< HelpEngine > HelpEnginePtr
HelpBrowser(QWidget *parent, HelpEnginePtr engine)
Namespace for all CustusX production code.