Commit 21121ab0 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

It's not necessary to create a view.

CCBUG: 391038
Perhaps it will fix this bug
parent 82f21da0
......@@ -41,11 +41,10 @@ InvokeWrapper<Arg, R, C> invoke(R *receiver, void (C::*memberFun)(Arg))
using namespace TemplateParser;
TemplateExtractHtmlElementWebEngineView::TemplateExtractHtmlElementWebEngineView(QWidget *parent)
: QWebEngineView(parent)
TemplateExtractHtmlElementWebEngineView::TemplateExtractHtmlElementWebEngineView(QObject *parent)
: QObject(parent)
{
mPage = new TemplateWebEnginePage(this);
setPage(mPage);
connect(mPage, &TemplateWebEnginePage::loadFinished, this, &TemplateExtractHtmlElementWebEngineView::slotLoadFinished);
}
......@@ -64,7 +63,7 @@ void TemplateExtractHtmlElementWebEngineView::setHtmlContent(const QString &html
{
clear();
mHtmlElement = html;
setHtml(html);
mPage->setHtml(html);
}
QString extractHeaderBodyScript()
......
......@@ -24,11 +24,11 @@
#include "templateparser_private_export.h"
namespace TemplateParser {
class TemplateWebEnginePage;
class TEMPLATEPARSER_TESTS_EXPORT TemplateExtractHtmlElementWebEngineView : public QWebEngineView
class TEMPLATEPARSER_TESTS_EXPORT TemplateExtractHtmlElementWebEngineView : public QObject
{
Q_OBJECT
public:
explicit TemplateExtractHtmlElementWebEngineView(QWidget *parent = nullptr);
explicit TemplateExtractHtmlElementWebEngineView(QObject *parent = nullptr);
~TemplateExtractHtmlElementWebEngineView();
QString bodyElement() const;
......
......@@ -40,11 +40,10 @@ InvokeWrapper<Arg, R, C> invoke(R *receiver, void (C::*memberFun)(Arg))
return wrapper;
}
TemplateWebEngineView::TemplateWebEngineView(QWidget *parent)
: QWebEngineView(parent)
TemplateWebEngineView::TemplateWebEngineView(QObject *parent)
: QObject(parent)
{
mPage = new TemplateWebEnginePage(this);
setPage(mPage);
connect(mPage, &TemplateWebEnginePage::loadFinished, this, &TemplateWebEngineView::slotLoadFinished);
}
......@@ -55,7 +54,7 @@ TemplateWebEngineView::~TemplateWebEngineView()
void TemplateWebEngineView::setHtmlContent(const QString &html)
{
mExtractedPlainText.clear();
setHtml(html);
mPage->setHtml(html);
}
void TemplateWebEngineView::slotLoadFinished(bool ok)
......
......@@ -25,11 +25,11 @@
namespace TemplateParser {
class TemplateWebEnginePage;
class TEMPLATEPARSER_EXPORT TemplateWebEngineView : public QWebEngineView
class TEMPLATEPARSER_EXPORT TemplateWebEngineView : public QObject
{
Q_OBJECT
public:
explicit TemplateWebEngineView(QWidget *parent = nullptr);
explicit TemplateWebEngineView(QObject *parent = nullptr);
~TemplateWebEngineView();
void setHtmlContent(const QString &html);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment