From 3c12baf9b42abee0e838fa8856ddc6bd20754201 Mon Sep 17 00:00:00 2001 From: sunwen Date: Thu, 25 Apr 2024 15:07:32 +0800 Subject: [PATCH] Update HelpForm with correct enviroment. --- src/forms/settings/HelpForm.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/forms/settings/HelpForm.cpp b/src/forms/settings/HelpForm.cpp index 4f82a43..f2af71e 100644 --- a/src/forms/settings/HelpForm.cpp +++ b/src/forms/settings/HelpForm.cpp @@ -5,6 +5,7 @@ #include #include #include +#include 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);