summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2025-11-20 10:54:00 +0100
committerMichal Klocek <michal.klocek@qt.io>2025-11-27 09:57:13 +0100
commit95a53e2467029e917d6d421a357c13d51aaa44db (patch)
tree6aafb348744ab0238eb0bcfbf8fc00057a01fd86 /src/plugins
parentddb86461871086d3ea5f9b6d58838a2dca427a0c (diff)
Pass the pointer to QWebView for private counterpart
QAbstarctWebView is going to be base class of pimpl for QWebView. Change-Id: I58636bc5017092e1b9360d05109a305d49899043 Reviewed-by: Kaloyan Chehlarski <kaloyan.chehlarski@qt.io> Reviewed-by: Moss Heim <moss.heim@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/android/qandroidwebview.cpp9
-rw-r--r--src/plugins/android/qandroidwebview_p.h2
-rw-r--r--src/plugins/android/qandroidwebviewplugin.cpp4
-rw-r--r--src/plugins/darwin/qdarwinwebview.mm5
-rw-r--r--src/plugins/darwin/qdarwinwebview_p.h2
-rw-r--r--src/plugins/darwin/qdarwinwebviewplugin.cpp4
-rw-r--r--src/plugins/wasm/qwasmwebview.cpp2
-rw-r--r--src/plugins/wasm/qwasmwebview_p.h2
-rw-r--r--src/plugins/wasm/qwasmwebviewplugin.cpp4
-rw-r--r--src/plugins/webengine/qwebenginewebview.cpp2
-rw-r--r--src/plugins/webengine/qwebenginewebview_p.h2
-rw-r--r--src/plugins/webengine/qwebenginewebviewplugin.cpp4
-rw-r--r--src/plugins/windows/qwebview2webview.cpp4
-rw-r--r--src/plugins/windows/qwebview2webview_p.h2
-rw-r--r--src/plugins/windows/qwebview2webviewplugin.cpp4
15 files changed, 27 insertions, 25 deletions
diff --git a/src/plugins/android/qandroidwebview.cpp b/src/plugins/android/qandroidwebview.cpp
index 4a61e5f..56e0b2a 100644
--- a/src/plugins/android/qandroidwebview.cpp
+++ b/src/plugins/android/qandroidwebview.cpp
@@ -76,9 +76,12 @@ void QAndroidWebViewSettingsPrivate::setAllowFileAccess(bool enabled)
typedef QSet<QAndroidWebViewPrivate *> WebViews;
Q_GLOBAL_STATIC(WebViews, g_webViews)
-QAndroidWebViewPrivate::QAndroidWebViewPrivate(QObject *p)
- : QAbstractWebView(p) , m_callbackId(0) , m_window(nullptr)
- , m_viewController(nullptr) , m_webView(nullptr)
+QAndroidWebViewPrivate::QAndroidWebViewPrivate(QWebView *view)
+ : QAbstractWebView(view),
+ m_callbackId(0),
+ m_window(nullptr),
+ m_viewController(nullptr),
+ m_webView(nullptr)
{
// QtAndroidWebViewController constructor blocks a qGuiThread until
// the WebView is created and configured in UI thread.
diff --git a/src/plugins/android/qandroidwebview_p.h b/src/plugins/android/qandroidwebview_p.h
index d3d951c..4f12268 100644
--- a/src/plugins/android/qandroidwebview_p.h
+++ b/src/plugins/android/qandroidwebview_p.h
@@ -56,7 +56,7 @@ class QAndroidWebViewPrivate : public QAbstractWebView
{
Q_OBJECT
public:
- explicit QAndroidWebViewPrivate(QObject *p = nullptr);
+ explicit QAndroidWebViewPrivate(QWebView *view);
~QAndroidWebViewPrivate() override;
QString httpUserAgent() const override;
diff --git a/src/plugins/android/qandroidwebviewplugin.cpp b/src/plugins/android/qandroidwebviewplugin.cpp
index cebd5bf..bceb553 100644
--- a/src/plugins/android/qandroidwebviewplugin.cpp
+++ b/src/plugins/android/qandroidwebviewplugin.cpp
@@ -13,9 +13,9 @@ class QAndroidWebViewPlugin : public QWebViewPlugin
Q_PLUGIN_METADATA(IID QWebViewPluginInterface_iid FILE "android.json")
public:
- QAbstractWebView *create(const QString &key) const override
+ QAbstractWebView *create(const QString &key, QWebView *view) const override
{
- return (key == QLatin1String("webview")) ? new QAndroidWebViewPrivate() : nullptr;
+ return (key == QLatin1String("webview")) ? new QAndroidWebViewPrivate(view) : nullptr;
}
};
diff --git a/src/plugins/darwin/qdarwinwebview.mm b/src/plugins/darwin/qdarwinwebview.mm
index 192b52e..099dced 100644
--- a/src/plugins/darwin/qdarwinwebview.mm
+++ b/src/plugins/darwin/qdarwinwebview.mm
@@ -257,9 +257,8 @@ void QDarwinWebViewSettingsPrivate::setAllowFileAccess(bool enabled)
m_allowFileAccess = enabled;
}
-QDarwinWebViewPrivate::QDarwinWebViewPrivate(QObject *p)
- : QAbstractWebView(p)
- , wkWebView(nil)
+QDarwinWebViewPrivate::QDarwinWebViewPrivate(QWebView *view)
+ : QAbstractWebView(view), wkWebView(nil)
{
CGRect frame = CGRectMake(0.0, 0.0, 400, 400);
wkWebView = [[WKWebView alloc] initWithFrame:frame];
diff --git a/src/plugins/darwin/qdarwinwebview_p.h b/src/plugins/darwin/qdarwinwebview_p.h
index 02c5c75..991a31c 100644
--- a/src/plugins/darwin/qdarwinwebview_p.h
+++ b/src/plugins/darwin/qdarwinwebview_p.h
@@ -57,7 +57,7 @@ class QDarwinWebViewPrivate : public QAbstractWebView
{
Q_OBJECT
public:
- explicit QDarwinWebViewPrivate(QObject *p = nullptr);
+ explicit QDarwinWebViewPrivate(QWebView *view);
~QDarwinWebViewPrivate() override;
QString httpUserAgent() const override;
diff --git a/src/plugins/darwin/qdarwinwebviewplugin.cpp b/src/plugins/darwin/qdarwinwebviewplugin.cpp
index 49621ed..d80e723 100644
--- a/src/plugins/darwin/qdarwinwebviewplugin.cpp
+++ b/src/plugins/darwin/qdarwinwebviewplugin.cpp
@@ -14,9 +14,9 @@ class QDarwinWebViewPlugin : public QWebViewPlugin
Q_PLUGIN_METADATA(IID QWebViewPluginInterface_iid FILE "darwin.json")
public:
- QAbstractWebView *create(const QString &key) const override
+ QAbstractWebView *create(const QString &key, QWebView *view) const override
{
- return (key == QLatin1String("webview")) ? new QDarwinWebViewPrivate() : nullptr;
+ return (key == QLatin1String("webview")) ? new QDarwinWebViewPrivate(view) : nullptr;
}
void prepare() const override
diff --git a/src/plugins/wasm/qwasmwebview.cpp b/src/plugins/wasm/qwasmwebview.cpp
index 10f8e32..011a19d 100644
--- a/src/plugins/wasm/qwasmwebview.cpp
+++ b/src/plugins/wasm/qwasmwebview.cpp
@@ -72,7 +72,7 @@ void QWasmWebViewSettingsPrivate::setAllowFileAccess(bool enabled)
qWarning("setAllowFileAccess() not supported on this platform");
}
-QWasmWebViewPrivate::QWasmWebViewPrivate(QObject *p) : QAbstractWebView(p), m_window(0)
+QWasmWebViewPrivate::QWasmWebViewPrivate(QWebView *view) : QAbstractWebView(view), m_window(0)
{
m_settings = new QWasmWebViewSettingsPrivate(this);
}
diff --git a/src/plugins/wasm/qwasmwebview_p.h b/src/plugins/wasm/qwasmwebview_p.h
index 39759d1..50fcc0e 100644
--- a/src/plugins/wasm/qwasmwebview_p.h
+++ b/src/plugins/wasm/qwasmwebview_p.h
@@ -52,7 +52,7 @@ class QWasmWebViewPrivate final : public QAbstractWebView
{
Q_OBJECT
public:
- explicit QWasmWebViewPrivate(QObject *p = nullptr);
+ explicit QWasmWebViewPrivate(QWebView *view);
~QWasmWebViewPrivate() override;
QString httpUserAgent() const final;
diff --git a/src/plugins/wasm/qwasmwebviewplugin.cpp b/src/plugins/wasm/qwasmwebviewplugin.cpp
index 83c713f..50c9ca0 100644
--- a/src/plugins/wasm/qwasmwebviewplugin.cpp
+++ b/src/plugins/wasm/qwasmwebviewplugin.cpp
@@ -13,9 +13,9 @@ class QWasmWebViewPlugin : public QWebViewPlugin
Q_PLUGIN_METADATA(IID QWebViewPluginInterface_iid FILE "wasm.json")
public:
- QAbstractWebView *create(const QString &key) const override
+ QAbstractWebView *create(const QString &key, QWebView *view) const override
{
- return key == QLatin1String("webview") ? new QWasmWebViewPrivate() : nullptr;
+ return key == QLatin1String("webview") ? new QWasmWebViewPrivate(view) : nullptr;
}
};
diff --git a/src/plugins/webengine/qwebenginewebview.cpp b/src/plugins/webengine/qwebenginewebview.cpp
index 244fb3c..a3a72dd 100644
--- a/src/plugins/webengine/qwebenginewebview.cpp
+++ b/src/plugins/webengine/qwebenginewebview.cpp
@@ -35,7 +35,7 @@ static QByteArray qmlSource()
"}\n");
}
-QWebEngineWebViewPrivate::QWebEngineWebViewPrivate(QObject *p)
+QWebEngineWebViewPrivate::QWebEngineWebViewPrivate(QWebView *p)
: QAbstractWebView(p), m_profile(nullptr)
{
m_settings = new QWebEngineWebViewSettingsPrivate(this);
diff --git a/src/plugins/webengine/qwebenginewebview_p.h b/src/plugins/webengine/qwebenginewebview_p.h
index 47fdb89..ff07192 100644
--- a/src/plugins/webengine/qwebenginewebview_p.h
+++ b/src/plugins/webengine/qwebenginewebview_p.h
@@ -66,7 +66,7 @@ class QWebEngineWebViewPrivate : public QAbstractWebView
{
Q_OBJECT
public:
- explicit QWebEngineWebViewPrivate(QObject *p = nullptr);
+ explicit QWebEngineWebViewPrivate(QWebView *p);
~QWebEngineWebViewPrivate() override;
QString httpUserAgent() const override;
diff --git a/src/plugins/webengine/qwebenginewebviewplugin.cpp b/src/plugins/webengine/qwebenginewebviewplugin.cpp
index e192951..556a934 100644
--- a/src/plugins/webengine/qwebenginewebviewplugin.cpp
+++ b/src/plugins/webengine/qwebenginewebviewplugin.cpp
@@ -13,9 +13,9 @@ class QWebEngineWebViewPlugin : public QWebViewPlugin
Q_PLUGIN_METADATA(IID QWebViewPluginInterface_iid FILE "webengine.json")
public:
- QAbstractWebView *create(const QString &key) const override
+ QAbstractWebView *create(const QString &key, QWebView *view) const override
{
- return (key == QLatin1String("webview")) ? new QWebEngineWebViewPrivate() : nullptr;
+ return (key == QLatin1String("webview")) ? new QWebEngineWebViewPrivate(view) : nullptr;
}
void prepare() const override { }
diff --git a/src/plugins/windows/qwebview2webview.cpp b/src/plugins/windows/qwebview2webview.cpp
index 0741261..6e71267 100644
--- a/src/plugins/windows/qwebview2webview.cpp
+++ b/src/plugins/windows/qwebview2webview.cpp
@@ -105,8 +105,8 @@ void QWebview2WebViewSettingsPrivate::setAllowFileAccess(bool enabled)
m_allowFileAccess = enabled;
}
-QWebView2WebViewPrivate::QWebView2WebViewPrivate(QObject *parent)
- : QAbstractWebView(parent),
+QWebView2WebViewPrivate::QWebView2WebViewPrivate(QWebView *view)
+ : QAbstractWebView(view),
m_settings(new QWebview2WebViewSettingsPrivate(this)),
m_window(new QWindow),
m_isLoading(false)
diff --git a/src/plugins/windows/qwebview2webview_p.h b/src/plugins/windows/qwebview2webview_p.h
index 44abc7f..2aa07d4 100644
--- a/src/plugins/windows/qwebview2webview_p.h
+++ b/src/plugins/windows/qwebview2webview_p.h
@@ -62,7 +62,7 @@ class QWebView2WebViewPrivate : public QAbstractWebView
{
Q_OBJECT
public:
- explicit QWebView2WebViewPrivate(QObject *parent = nullptr);
+ explicit QWebView2WebViewPrivate(QWebView *view);
~QWebView2WebViewPrivate() override;
QString httpUserAgent() const override;
diff --git a/src/plugins/windows/qwebview2webviewplugin.cpp b/src/plugins/windows/qwebview2webviewplugin.cpp
index c674df3..e8a0432 100644
--- a/src/plugins/windows/qwebview2webviewplugin.cpp
+++ b/src/plugins/windows/qwebview2webviewplugin.cpp
@@ -13,9 +13,9 @@ class QWebView2WebViewPlugin : public QWebViewPlugin
Q_PLUGIN_METADATA(IID QWebViewPluginInterface_iid FILE "windows.json")
public:
- QAbstractWebView *create(const QString &key) const override
+ QAbstractWebView *create(const QString &key, QWebView *view) const override
{
- return (key == QLatin1String("webview")) ? new QWebView2WebViewPrivate() : nullptr;
+ return (key == QLatin1String("webview")) ? new QWebView2WebViewPrivate(view) : nullptr;
}
};