25 lines
818 B
C++
Raw Normal View History

#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);
}