-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhelpwindow.cpp
More file actions
executable file
·32 lines (25 loc) · 978 Bytes
/
helpwindow.cpp
File metadata and controls
executable file
·32 lines (25 loc) · 978 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "helpwindow.h"
#include "ui_helpwindow.h"
HelpWindow::HelpWindow(QWidget *parent) :
QFrame(parent),
ui(new Ui::HelpWindow)
{
ui->setupUi(this);
this->setAttribute(Qt::WA_DeleteOnClose);
QHelpEngine *helpEngine = new QHelpEngine(QApplication::applicationDirPath()+"/docs/OpenFOAM Docs.qhc",this);
helpEngine->setupData();
QTabWidget *tWidget = new QTabWidget(this);
tWidget->setMaximumWidth(200);
tWidget->setMinimumWidth(200);
tWidget->addTab(helpEngine->contentWidget(),"Contents");
tWidget->addTab(helpEngine->indexWidget(),"Index");
HelpBrowser *textViewer = new HelpBrowser(helpEngine,this);
textViewer->setSource(QUrl("qthelp://openfoamdocs/doc/Setup.html"));
HelpWindow::layout()->addWidget(tWidget);
HelpWindow::layout()->addWidget(textViewer);
connect(helpEngine->contentWidget(),SIGNAL(linkActivated(QUrl)),textViewer,SLOT(setSource(QUrl)));
}
HelpWindow::~HelpWindow()
{
delete ui;
}