Commit f02cdc1f authored by Laurent Montel's avatar Laurent Montel 😁

Load url

parent 71bfe5e3
......@@ -31,6 +31,7 @@ TestMailWebEngine::TestMailWebEngine(QWidget *parent)
mZoom = 1.0;
QVBoxLayout *vbox = new QVBoxLayout(this);
mTestWebEngine = new MessageViewer::MailWebEngineView(new KActionCollection(this), this);
connect(mTestWebEngine, &MessageViewer::MailWebEngineView::openUrl, this, &TestMailWebEngine::slotOpenUrl);
mTestWebEngine->load(QUrl(QStringLiteral("http://www.kde.org")));
mTestWebEngine->settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, true);
vbox->addWidget(mTestWebEngine);
......@@ -62,6 +63,11 @@ TestMailWebEngine::~TestMailWebEngine()
}
void TestMailWebEngine::slotOpenUrl(const QUrl &url)
{
mTestWebEngine->load(url);
}
void TestMailWebEngine::slotScrollDown()
{
mTestWebEngine->page()->runJavaScript(WebEngineViewer::WebEngineScript::scrollDown(10));
......
......@@ -37,6 +37,7 @@ private Q_SLOTS:
void slotScrollDown();
void slotZoomUp();
void slotZoomDown();
void slotOpenUrl(const QUrl &url);
private:
MessageViewer::MailWebEngineView *mTestWebEngine;
qreal mZoom;
......
Markdown is supported
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