Update HelpForm with correct enviroment.

This commit is contained in:
sunwen
2024-04-25 15:07:32 +08:00
parent 0c9019a004
commit 3c12baf9b4

View File

@@ -5,6 +5,7 @@
#include <QWebEnginePage>
#include <QVBoxLayout>
#include <QWebEngineProfile>
#include <QApplication>
HelpForm::HelpForm(QWidget* aParent)
: QWidget(aParent)
@@ -19,7 +20,8 @@ HelpForm::~HelpForm()
void HelpForm::init()
{
mPdfWidget->setUrl(QUrl("file:///home/sun/GUI/web/web/viewer.html?file=file:///home/sun/GUI/web/web/compressed.tracemonkey-pldi-09.pdf"));
QString path = QApplication::applicationDirPath();
mPdfWidget->setUrl(QUrl("file://" + path +"/web/web/viewer.html?file=file://" + path +"/cfgs/help.pdf"));
QWebChannel * channel = new QWebChannel(this);
channel->registerObject(QStringLiteral("communicator"), new QObject(this));
mPdfWidget->page()->setWebChannel(channel);