MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / HelpDialog

Method HelpDialog

gui/helpdialog.cpp:77–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77HelpDialog::HelpDialog(QWidget *parent) :
78 QDialog(parent),
79 mUi(new Ui::HelpDialog)
80{
81 mUi->setupUi(this);
82
83 QString helpFile = getHelpFile();
84 if (helpFile.isEmpty()) {
85 const QString msg = tr("Helpfile '%1' was not found").arg("online-help.qhc");
86 QMessageBox msgBox(QMessageBox::Warning,
87 tr("Cppcheck"),
88 msg,
89 QMessageBox::Ok,
90 this);
91 msgBox.exec();
92 mHelpEngine = nullptr;
93 return;
94 }
95
96 mHelpEngine = new QHelpEngine(helpFile);
97 // Disable the timestamp check of online-help.qhc by setting _q_readonly
98 mHelpEngine->setProperty("_q_readonly", QVariant::fromValue<bool>(true));
99 mHelpEngine->setupData();
100
101 mUi->contents->addWidget(mHelpEngine->contentWidget());
102 mUi->index->addWidget(mHelpEngine->indexWidget());
103
104 mUi->textBrowser->setHelpEngine(mHelpEngine);
105
106 mUi->textBrowser->setSource(QUrl("qthelp://cppcheck.sourceforge.io/doc/index.html"));
107 connect(mHelpEngine->contentWidget(),
108 SIGNAL(linkActivated(QUrl)),
109 mUi->textBrowser,
110 SLOT(setSource(QUrl)));
111
112 connect(mHelpEngine->indexWidget(),
113 SIGNAL(linkActivated(QUrl,QString)),
114 mUi->textBrowser,
115 SLOT(setSource(QUrl)));
116}
117
118HelpDialog::~HelpDialog()
119{

Callers

nothing calls this directly

Calls 3

getHelpFileFunction · 0.85
isEmptyMethod · 0.80
setHelpEngineMethod · 0.80

Tested by

no test coverage detected