aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside6')
-rw-r--r--sources/pyside6/PySide6/QtWebEngineCore/typesystem_webenginecore.xml3
-rw-r--r--sources/pyside6/PySide6/glue/qtwebenginecore.cpp17
2 files changed, 20 insertions, 0 deletions
diff --git a/sources/pyside6/PySide6/QtWebEngineCore/typesystem_webenginecore.xml b/sources/pyside6/PySide6/QtWebEngineCore/typesystem_webenginecore.xml
index 478621736..9514100e4 100644
--- a/sources/pyside6/PySide6/QtWebEngineCore/typesystem_webenginecore.xml
+++ b/sources/pyside6/PySide6/QtWebEngineCore/typesystem_webenginecore.xml
@@ -111,6 +111,9 @@
<object-type name="QWebEngineProfile">
<enum-type name="HttpCacheType"/>
<enum-type name="PersistentCookiesPolicy"/>
+ <add-function signature="setNotificationPresenter(PyCallable* @notificationPresenter@)">
+ <inject-code class="target" position="beginning" file="../glue/qtwebenginecore.cpp" snippet="qwebengineprofile-setnotificationpresenter"/>
+ </add-function>
</object-type>
<object-type name="QWebEngineNewWindowRequest">
diff --git a/sources/pyside6/PySide6/glue/qtwebenginecore.cpp b/sources/pyside6/PySide6/glue/qtwebenginecore.cpp
index 41fe99440..a0a08af40 100644
--- a/sources/pyside6/PySide6/glue/qtwebenginecore.cpp
+++ b/sources/pyside6/PySide6/glue/qtwebenginecore.cpp
@@ -53,3 +53,20 @@ auto callback = [callable](const QWebEngineCookieStore::FilterRequest& filterReq
};
%CPPSELF.%FUNCTION_NAME(callback);
// @snippet qwebenginecookiestore-setcookiefilter
+
+// @snippet qwebengineprofile-setnotificationpresenter
+auto callable = %PYARG_1;
+auto callback = [callable](std::unique_ptr<QWebEngineNotification> webEngineNotification) -> void
+{
+ Shiboken::GilState state;
+ Shiboken::AutoDecRef arglist(PyTuple_New(1));
+ PyTuple_SET_ITEM(arglist.object(), 0,
+ Shiboken::Conversions::pointerToPython(
+ SbkPySide6_QtWebEngineCoreTypes[SBK_QWEBENGINENOTIFICATION_IDX],
+ webEngineNotification.release()));
+ Py_INCREF(callable);
+ PyObject_CallObject(callable, arglist);
+ Py_DECREF(callable);
+};
+%CPPSELF.%FUNCTION_NAME(callback);
+// @snippet qwebengineprofile-setnotificationpresenter