mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00

Make it convenient to add third-party libraries. Signed-off-by: Le Tan <tamlokveer@gmail.com>
20 lines
492 B
C++
20 lines
492 B
C++
#include "vpreviewpage.h"
|
|
|
|
#include <QDesktopServices>
|
|
|
|
VPreviewPage::VPreviewPage(QWidget *parent) : QWebEnginePage(parent)
|
|
{
|
|
|
|
}
|
|
|
|
bool VPreviewPage::acceptNavigationRequest(const QUrl &url,
|
|
QWebEnginePage::NavigationType /*type*/,
|
|
bool /*isMainFrame*/)
|
|
{
|
|
// Only allow qrc:/index.html.
|
|
if (url.scheme() == QString("qrc"))
|
|
return true;
|
|
QDesktopServices::openUrl(url);
|
|
return false;
|
|
}
|