2025-03-14 17:05:48 +08:00
|
|
|
#include "CReportWebView.h"
|
|
|
|
|
#include <QWebEngineSettings>
|
|
|
|
|
#include <QWebEngineProfile>
|
|
|
|
|
#include <CReportStackedWidget.h>
|
|
|
|
|
|
|
|
|
|
CReportWebView::CReportWebView(QWidget *parent)
|
|
|
|
|
: QWebEngineView(parent)
|
|
|
|
|
{
|
|
|
|
|
this->setContextMenuPolicy(Qt::NoContextMenu);
|
|
|
|
|
// this->settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled,false);
|
|
|
|
|
// this->page()->profile()->setPersistentCookiesPolicy(QWebEngineProfile::NoPersistentCookies);
|
|
|
|
|
// this->page()->profile()->setHttpCacheType(QWebEngineProfile::NoCache);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QWebEngineView *CReportWebView::createWindow(QWebEnginePage::WebWindowType type)
|
|
|
|
|
{
|
|
|
|
|
CReportStackedWidget *StackedWidget = qobject_cast<CReportStackedWidget*>(parentWidget());
|
|
|
|
|
if (!StackedWidget)
|
|
|
|
|
{
|
|
|
|
|
return nullptr;
|
|
|
|
|
}
|
|
|
|
|
return StackedWidget->getView(1);
|
|
|
|
|
}
|
|
|
|
|
|