23 #include "ui_helpdialog.h"
25 #include <QApplication>
27 #include <QHelpEngine>
28 #include <QHelpContentWidget>
29 #include <QHelpIndexWidget>
30 #include <QMessageBox>
31 #include <QStringList>
33 #include <QVBoxLayout>
44 if (name.scheme() ==
"qthelp") {
45 QString url(name.toString());
46 while (url.indexOf(
"/./") > 0)
47 url.remove(url.indexOf(
"/./"), 2);
50 return QTextBrowser::loadResource(type, name);
58 paths << (datadir +
"/help")
60 << (QApplication::applicationDirPath() +
"/help")
61 << QApplication::applicationDirPath();
63 const QString filesdir = FILESDIR;
64 paths << (filesdir +
"/help")
67 for (
const QString &p: paths) {
68 QString filename = p +
"/online-help.qhc";
69 if (QFileInfo::exists(filename))
82 if (helpFile.isEmpty()) {
83 const QString msg = tr(
"Helpfile '%1' was not found").arg(
"online-help.qhc");
84 QMessageBox msgBox(QMessageBox::Warning,
96 mHelpEngine->setProperty(
"_q_readonly", QVariant::fromValue<bool>(
true));
104 mUi->textBrowser->setSource(QUrl(
"qthelp://cppcheck.sourceforge.io/doc/index.html"));
106 SIGNAL(linkActivated(QUrl)),
108 SLOT(setSource(QUrl)));
111 SIGNAL(linkActivated(QUrl,QString)),
113 SLOT(setSource(QUrl)));
void setHelpEngine(QHelpEngine *helpEngine)
QVariant loadResource(int type, const QUrl &name) override
QHelpEngine * mHelpEngine
QHelpEngine * mHelpEngine
HelpDialog(QWidget *parent=nullptr)
QString getDataDir()
Get configured data dir.
static QString getHelpFile()