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