aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <[email protected]>2024-10-07 09:56:41 +0200
committerFriedemann Kleint <[email protected]>2024-10-07 15:35:32 +0200
commitc68ae5cabffff255307c785debbfe82c2ce5f722 (patch)
tree20a437f43f8bde52f5ba5cc0dca40f9dfaac9a15
parent1e5fe140b485209a30d7dd38b3334440c58cbb05 (diff)
PySide6: Add parameter names to QWebEnginePage's added functions
As a drive-by, change the callbacks to PyCallable* and remove the parameter checks from the snippets. Task-number: PYSIDE-2883 Task-number: PYSIDE-946 Change-Id: I3986d2eced9606c71a3071755dce935b30cd67a5 Reviewed-by: Shyamnath Premnadh <[email protected]>
-rw-r--r--sources/pyside6/PySide6/QtWebEngineCore/typesystem_webenginecore.xml8
-rw-r--r--sources/pyside6/PySide6/QtWebEngineWidgets/typesystem_webenginewidgets.xml2
-rw-r--r--sources/pyside6/PySide6/glue/qtwebenginewidgets.cpp12
3 files changed, 5 insertions, 17 deletions
diff --git a/sources/pyside6/PySide6/QtWebEngineCore/typesystem_webenginecore.xml b/sources/pyside6/PySide6/QtWebEngineCore/typesystem_webenginecore.xml
index 1f2e9c790..c68db5ece 100644
--- a/sources/pyside6/PySide6/QtWebEngineCore/typesystem_webenginecore.xml
+++ b/sources/pyside6/PySide6/QtWebEngineCore/typesystem_webenginecore.xml
@@ -94,16 +94,16 @@
<inject-code class="target" position="beginning" file="../glue/qtwebenginecore.cpp"
snippet="qwebenginepage-javascriptprompt-return"/>
</modify-function>
- <add-function signature="findText(const QString &amp;,QWebEnginePage::FindFlags,PyObject*)">
+ <add-function signature="findText(const QString &amp;@subString@,QWebEnginePage::FindFlags@options@,PyCallable*@resultCallback@)">
<inject-code class="target" position="beginning" file="../glue/qtwebenginewidgets.cpp" snippet="qwebenginepage-findtext"/>
</add-function>
- <add-function signature="toPlainText(PyObject*) const">
+ <add-function signature="toPlainText(PyCallable*@resultCallback@) const">
<inject-code class="target" position="beginning" file="../glue/qtwebenginewidgets.cpp" snippet="qwebenginepage-convertto"/>
</add-function>
- <add-function signature="toHtml(PyObject*) const">
+ <add-function signature="toHtml(PyCallable*@resultCallback@) const">
<inject-code class="target" position="beginning" file="../glue/qtwebenginewidgets.cpp" snippet="qwebenginepage-convertto"/>
</add-function>
- <add-function signature="runJavaScript(const QString &amp;,quint32,PyObject*)">
+ <add-function signature="runJavaScript(const QString &amp;@scriptSource@,quint32@worldId@,PyCallable*@resultCallback@)">
<inject-code class="target" position="beginning" file="../glue/qtwebenginewidgets.cpp" snippet="qwebenginepage-runjavascript"/>
</add-function>
</object-type>
diff --git a/sources/pyside6/PySide6/QtWebEngineWidgets/typesystem_webenginewidgets.xml b/sources/pyside6/PySide6/QtWebEngineWidgets/typesystem_webenginewidgets.xml
index cfcdbe886..811523587 100644
--- a/sources/pyside6/PySide6/QtWebEngineWidgets/typesystem_webenginewidgets.xml
+++ b/sources/pyside6/PySide6/QtWebEngineWidgets/typesystem_webenginewidgets.xml
@@ -13,7 +13,7 @@
<load-typesystem name="QtPrintSupport/typesystem_printsupport.xml" generate="no"/>
<object-type name="QWebEngineView">
- <add-function signature="findText(const QString &amp;,QWebEnginePage::FindFlags,PyObject*)">
+ <add-function signature="findText(const QString &amp;@subString@,QWebEnginePage::FindFlags@options@,PyCallable*@resultCallback@)">
<inject-code class="target" position="beginning" file="../glue/qtwebenginewidgets.cpp" snippet="qwebenginepage-findtext"/>
</add-function>
</object-type>
diff --git a/sources/pyside6/PySide6/glue/qtwebenginewidgets.cpp b/sources/pyside6/PySide6/glue/qtwebenginewidgets.cpp
index af15130a4..1235c123d 100644
--- a/sources/pyside6/PySide6/glue/qtwebenginewidgets.cpp
+++ b/sources/pyside6/PySide6/glue/qtwebenginewidgets.cpp
@@ -5,10 +5,6 @@
auto callable = %PYARG_3;
auto callback = [callable](const QWebEngineFindTextResult &result)
{
- if (!PyCallable_Check(callable)) {
- qWarning("Argument 3 of %FUNCTION_NAME must be a callable.");
- return;
- }
Shiboken::GilState state;
Shiboken::AutoDecRef arglist(PyTuple_New(1));
PyTuple_SET_ITEM(arglist, 0, %CONVERTTOPYTHON[QWebEngineFindTextResult](result));
@@ -46,10 +42,6 @@ Py_INCREF(callable);
auto callable = %PYARG_1;
auto callback = [callable](const QString &text)
{
- if (!PyCallable_Check(callable)) {
- qWarning("Argument 1 of %FUNCTION_NAME must be a callable.");
- return;
- }
Shiboken::GilState state;
Shiboken::AutoDecRef arglist(PyTuple_New(1));
PyTuple_SET_ITEM(arglist, 0, %CONVERTTOPYTHON[QString](text));
@@ -65,10 +57,6 @@ Py_INCREF(callable);
auto callable = %PYARG_3;
auto callback = [callable](const QVariant &result)
{
- if (!PyCallable_Check(callable)) {
- qWarning("Argument 3 of %FUNCTION_NAME must be a callable.");
- return;
- }
Shiboken::GilState state;
Shiboken::AutoDecRef arglist(PyTuple_New(1));
switch (result.type()) {