summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/webengine/api/qquickwebengineview.cpp8
-rw-r--r--src/webengine/api/qquickwebengineview_p.h2
-rw-r--r--src/webengine/api/qquickwebengineview_p_p.h4
-rw-r--r--src/webengine/render_widget_host_view_qt_delegate_quick.cpp1
-rw-r--r--src/webenginewidgets/api/qwebenginepage.cpp11
-rw-r--r--src/webenginewidgets/api/qwebenginepage.h1
-rw-r--r--src/webenginewidgets/api/qwebenginepage_p.h4
-rw-r--r--src/webenginewidgets/api/qwebengineview.cpp9
-rw-r--r--src/webenginewidgets/api/qwebengineview.h1
-rw-r--r--src/webenginewidgets/api/qwebengineview_p.h4
10 files changed, 29 insertions, 16 deletions
diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp
index cbd45842..ad57f24b 100644
--- a/src/webengine/api/qquickwebengineview.cpp
+++ b/src/webengine/api/qquickwebengineview.cpp
@@ -384,8 +384,9 @@ QObject *QQuickWebEngineViewPrivate::accessibilityParentObject()
void QQuickWebEngineViewPrivate::setDevicePixelRatio(qreal devicePixelRatio)
{
+ Q_Q(QQuickWebEngineView);
this->devicePixelRatio = devicePixelRatio;
- QScreen *screen = window ? window->screen() : QGuiApplication::primaryScreen();
+ QScreen *screen = q->window() ? q->window()->screen() : QGuiApplication::primaryScreen();
m_dpiScale = devicePixelRatio / screen->devicePixelRatio();
}
@@ -463,10 +464,11 @@ void QQuickWebEngineViewPrivate::adoptWebContents(WebContentsAdapter *webContent
}
QQuickWebEngineView::QQuickWebEngineView(QQuickItem *parent)
- : QQuickItem(*(new QQuickWebEngineViewPrivate), parent)
+ : QQuickItem(parent)
+ , d_ptr(new QQuickWebEngineViewPrivate)
{
Q_D(QQuickWebEngineView);
- d->e->q_ptr = this;
+ d->e->q_ptr = d->q_ptr = this;
d->adapter->initialize(d);
this->setActiveFocusOnTab(true);
this->setFlag(QQuickItem::ItemIsFocusScope);
diff --git a/src/webengine/api/qquickwebengineview_p.h b/src/webengine/api/qquickwebengineview_p.h
index c03f1ec5..12b9ee16 100644
--- a/src/webengine/api/qquickwebengineview_p.h
+++ b/src/webengine/api/qquickwebengineview_p.h
@@ -132,6 +132,8 @@ protected:
private:
Q_DECLARE_PRIVATE(QQuickWebEngineView)
+ QScopedPointer<QQuickWebEngineViewPrivate> d_ptr;
+
friend class QQuickWebEngineViewExperimental;
friend class QQuickWebEngineViewExperimentalExtension;
friend class QQuickWebEngineNewViewRequest;
diff --git a/src/webengine/api/qquickwebengineview_p_p.h b/src/webengine/api/qquickwebengineview_p_p.h
index e4a315d1..25b20a0e 100644
--- a/src/webengine/api/qquickwebengineview_p_p.h
+++ b/src/webengine/api/qquickwebengineview_p_p.h
@@ -49,7 +49,6 @@
#include <QSharedData>
#include <QString>
#include <QtCore/qcompilerdetection.h>
-#include <QtQuick/private/qquickitem_p.h>
#include <QtGui/qaccessibleobject.h>
class WebContentsAdapter;
@@ -128,10 +127,11 @@ private:
Q_DECLARE_PUBLIC(QQuickWebEngineView)
};
-class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineViewPrivate : public QQuickItemPrivate, public WebContentsAdapterClient
+class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineViewPrivate : public WebContentsAdapterClient
{
public:
Q_DECLARE_PUBLIC(QQuickWebEngineView)
+ QQuickWebEngineView *q_ptr;
QQuickWebEngineViewPrivate();
~QQuickWebEngineViewPrivate();
diff --git a/src/webengine/render_widget_host_view_qt_delegate_quick.cpp b/src/webengine/render_widget_host_view_qt_delegate_quick.cpp
index 26afda08..e968f450 100644
--- a/src/webengine/render_widget_host_view_qt_delegate_quick.cpp
+++ b/src/webengine/render_widget_host_view_qt_delegate_quick.cpp
@@ -48,6 +48,7 @@
#include <QQuickWindow>
#include <QVariant>
#include <QWindow>
+#include <QtQuick/private/qquickwindow_p.h>
RenderWidgetHostViewQtDelegateQuick::RenderWidgetHostViewQtDelegateQuick(RenderWidgetHostViewQtDelegateClient *client, bool isPopup)
: m_client(client)
diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp
index fd1f5483..10e3dcda 100644
--- a/src/webenginewidgets/api/qwebenginepage.cpp
+++ b/src/webenginewidgets/api/qwebenginepage.cpp
@@ -42,6 +42,7 @@
#include <QMenu>
#include <QMessageBox>
#include <QStandardPaths>
+#include <QStyle>
#include <QUrl>
QT_BEGIN_NAMESPACE
@@ -162,12 +163,10 @@ void CallbackDirectory::CallbackSharedDataPointer::doDeref()
}
QWebEnginePagePrivate::QWebEnginePagePrivate()
- : QObjectPrivate(QObjectPrivateVersion)
- , adapter(new WebContentsAdapter)
+ : adapter(new WebContentsAdapter)
, history(new QWebEngineHistory(new QWebEngineHistoryPrivate(this)))
, view(0)
{
- adapter->initialize(this);
memset(actions, 0, sizeof(actions));
}
@@ -407,8 +406,12 @@ void QWebEnginePagePrivate::recreateFromSerializedHistory(QDataStream &input)
}
QWebEnginePage::QWebEnginePage(QObject* parent)
- : QObject(*new QWebEnginePagePrivate, parent)
+ : QObject(parent)
+ , d_ptr(new QWebEnginePagePrivate)
{
+ Q_D(QWebEnginePage);
+ d->q_ptr = this;
+ d->adapter->initialize(d);
}
QWebEnginePage::~QWebEnginePage()
diff --git a/src/webenginewidgets/api/qwebenginepage.h b/src/webenginewidgets/api/qwebenginepage.h
index bd1e5c7a..7d4a00e7 100644
--- a/src/webenginewidgets/api/qwebenginepage.h
+++ b/src/webenginewidgets/api/qwebenginepage.h
@@ -213,6 +213,7 @@ protected:
private:
Q_DECLARE_PRIVATE(QWebEnginePage);
+ QScopedPointer<QWebEnginePagePrivate> d_ptr;
#ifndef QT_NO_ACTION
Q_PRIVATE_SLOT(d_func(), void _q_webActionTriggered(bool checked))
#endif
diff --git a/src/webenginewidgets/api/qwebenginepage_p.h b/src/webenginewidgets/api/qwebenginepage_p.h
index 3f421ed7..90924bd8 100644
--- a/src/webenginewidgets/api/qwebenginepage_p.h
+++ b/src/webenginewidgets/api/qwebenginepage_p.h
@@ -45,7 +45,6 @@
#include "qwebenginepage.h"
#include "web_contents_adapter_client.h"
-#include <QtCore/private/qobject_p.h>
#include <QtCore/qcompilerdetection.h>
#include <QSharedData>
@@ -100,10 +99,11 @@ private:
QHash<quint64, CallbackSharedDataPointer> m_callbackMap;
};
-class QWebEnginePagePrivate : public QObjectPrivate, public WebContentsAdapterClient
+class QWebEnginePagePrivate : public WebContentsAdapterClient
{
public:
Q_DECLARE_PUBLIC(QWebEnginePage)
+ QWebEnginePage *q_ptr;
QWebEnginePagePrivate();
~QWebEnginePagePrivate();
diff --git a/src/webenginewidgets/api/qwebengineview.cpp b/src/webenginewidgets/api/qwebengineview.cpp
index 03bb474b..13ee75cf 100644
--- a/src/webenginewidgets/api/qwebengineview.cpp
+++ b/src/webenginewidgets/api/qwebengineview.cpp
@@ -99,16 +99,19 @@ static QAccessibleInterface *webAccessibleFactory(const QString &, QObject *obje
}
QWebEngineViewPrivate::QWebEngineViewPrivate()
- : QWidgetPrivate(QObjectPrivateVersion)
- , page(0)
+ : page(0)
, m_pendingContextMenuEvent(false)
{
QAccessible::installFactory(&webAccessibleFactory);
}
QWebEngineView::QWebEngineView(QWidget *parent)
- : QWidget(*(new QWebEngineViewPrivate), parent, 0)
+ : QWidget(parent)
+ , d_ptr(new QWebEngineViewPrivate)
{
+ Q_D(QWebEngineView);
+ d->q_ptr = this;
+
// This causes the child RenderWidgetHostViewQtDelegateWidgets to fill this widget.
setLayout(new QStackedLayout);
}
diff --git a/src/webenginewidgets/api/qwebengineview.h b/src/webenginewidgets/api/qwebengineview.h
index c3ebfba0..f96833b1 100644
--- a/src/webenginewidgets/api/qwebengineview.h
+++ b/src/webenginewidgets/api/qwebengineview.h
@@ -99,6 +99,7 @@ protected:
private:
Q_DECLARE_PRIVATE(QWebEngineView);
+ QScopedPointer<QWebEngineViewPrivate> d_ptr;
friend class QWebEnginePage;
friend class QWebEnginePagePrivate;
diff --git a/src/webenginewidgets/api/qwebengineview_p.h b/src/webenginewidgets/api/qwebengineview_p.h
index b3156a35..fd6fb3b6 100644
--- a/src/webenginewidgets/api/qwebengineview_p.h
+++ b/src/webenginewidgets/api/qwebengineview_p.h
@@ -42,7 +42,6 @@
#ifndef QWEBENGINEVIEW_P_H
#define QWEBENGINEVIEW_P_H
-#include <QtWidgets/private/qwidget_p.h>
#include <QtWebEngineWidgets/qwebengineview.h>
#include <QtWidgets/qaccessiblewidget.h>
@@ -51,10 +50,11 @@ QT_BEGIN_NAMESPACE
class QWebEngineView;
-class QWebEngineViewPrivate : public QWidgetPrivate
+class QWebEngineViewPrivate
{
public:
Q_DECLARE_PUBLIC(QWebEngineView)
+ QWebEngineView *q_ptr;
static void bind(QWebEngineView *view, QWebEnginePage *page);