<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Why does calling dynamicCall and querySubObject always get an error in QAxWidget?]]></title><description><![CDATA[<p dir="auto">The development environment is python 3.11 + pyside6. When calling dynamicCall and querySubObject, there is always an error message saying "Unexpected type: (str, int) possible type: (bytes, any)(bytes, sequence)", the code example used is as follows, please see what went wrong? Can you provide the correct call method?</p>
<p dir="auto">self.ax_widget2.dynamicCall("ActiveDocument.GoTo(int)", 10)</p>
]]></description><link>https://forum.qt.io/topic/152615/why-does-calling-dynamiccall-and-querysubobject-always-get-an-error-in-qaxwidget</link><generator>RSS for Node</generator><lastBuildDate>Tue, 14 Jul 2026 06:43:40 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/152615.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 05 Dec 2023 04:08:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Why does calling dynamicCall and querySubObject always get an error in QAxWidget? on Wed, 06 Dec 2023 11:39:58 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/howerl">@<bdi>howerl</bdi></a><br />
There are no docs with extra details....  Things are supposed to work in principle as from C++, and the PySide docs are mostly translations from that.</p>
]]></description><link>https://forum.qt.io/post/782034</link><guid isPermaLink="true">https://forum.qt.io/post/782034</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Wed, 06 Dec 2023 11:39:58 GMT</pubDate></item><item><title><![CDATA[Reply to Why does calling dynamicCall and querySubObject always get an error in QAxWidget? on Tue, 05 Dec 2023 23:59:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> Thanks！do you know where i can find docs of PySide6 for more details?</p>
]]></description><link>https://forum.qt.io/post/781992</link><guid isPermaLink="true">https://forum.qt.io/post/781992</guid><dc:creator><![CDATA[howerl]]></dc:creator><pubDate>Tue, 05 Dec 2023 23:59:52 GMT</pubDate></item><item><title><![CDATA[Reply to Why does calling dynamicCall and querySubObject always get an error in QAxWidget? on Tue, 05 Dec 2023 16:10:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/howerl">@<bdi>howerl</bdi></a> said in <a href="/post/781940">Why does calling dynamicCall and querySubObject always get an error in QAxWidget?</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> I tried it in PyQt6, it looks like right.</p>
</blockquote>
<p dir="auto">Yes, I thought that might be the case.  Indicating that what you are trying to do is in principle correct, but PySide has flaws.  Did you try the <code>[ 10 ]</code> list argument in place of the <code>10</code> integer argument, in case PySide accepts that?</p>
<p dir="auto">P.S.<br />
You would need a Qt PySide person to look at this.  I don't know whether it's appropriate, but I'm putting a shout-out to <a class="plugin-mentions-user plugin-mentions-a" href="/user/cristianmaureira">@<bdi>CristianMaureira</bdi></a> here, he seemed to answer a question recently implying he is a Qt in-house PySide development type?</p>
]]></description><link>https://forum.qt.io/post/781943</link><guid isPermaLink="true">https://forum.qt.io/post/781943</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Tue, 05 Dec 2023 16:10:52 GMT</pubDate></item><item><title><![CDATA[Reply to Why does calling dynamicCall and querySubObject always get an error in QAxWidget? on Tue, 05 Dec 2023 14:15:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> I tried it in PyQt6, it looks like right. It's a weird thing that the same syntax doesn't report errors on PyQt6, but not on PySide6. And PySide6 lacks a corresponding explanation, which is simply too bad.</p>
]]></description><link>https://forum.qt.io/post/781940</link><guid isPermaLink="true">https://forum.qt.io/post/781940</guid><dc:creator><![CDATA[howerl]]></dc:creator><pubDate>Tue, 05 Dec 2023 14:15:24 GMT</pubDate></item><item><title><![CDATA[Reply to Why does calling dynamicCall and querySubObject always get an error in QAxWidget? on Tue, 05 Dec 2023 12:52:56 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/howerl">@<bdi>howerl</bdi></a> said in <a href="/post/781917">Why does calling dynamicCall and querySubObject always get an error in QAxWidget?</a>:</p>
<blockquote>
<p dir="auto"><code>PySide6.QtAxContainer.QAxBase.dynamicCall(b'ActiveDocument.GoTo(int)', 10)</code></p>
</blockquote>
<p dir="auto">The <code>b'...'</code> makes it a <code>bytes</code> type, as expected.  I do not know why Python says</p>
<pre><code>PySide6.QtAxContainer.QAxBase.dynamicCall(bytes, Any = Invalid(typing.Any), Any = Invalid(typing.Any), Any = Invalid(typing.Any), Any = Invalid(typing.Any), Any = Invalid(typing.Any), Any = Invalid(typing.Any), Any = Invalid(typing.Any), Any = Invalid(typing.Any))
</code></pre>
<p dir="auto">is not a matching signature for your call.</p>
<p dir="auto">If you are able to temporarily install PyQt6 you could try this call there and see whether it is accepted/rejected.  In the past there have been cases where PyQt accepts things correctly where PySide does not.</p>
<p dir="auto">P.S.<br />
I'm not all sure this will work, but you might try</p>
<pre><code>dynamicCall(b'ActiveDocument.GoTo(int)', [ 10 ])`
</code></pre>
<p dir="auto">to see if that is accepted.</p>
]]></description><link>https://forum.qt.io/post/781923</link><guid isPermaLink="true">https://forum.qt.io/post/781923</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Tue, 05 Dec 2023 12:52:56 GMT</pubDate></item><item><title><![CDATA[Reply to Why does calling dynamicCall and querySubObject always get an error in QAxWidget? on Tue, 05 Dec 2023 11:55:40 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/hskoglund">@<bdi>hskoglund</bdi></a> I'm very confused about the syntax of pyside6, there is very little information on the Internet, and I can't find a standard usage also</p>
]]></description><link>https://forum.qt.io/post/781918</link><guid isPermaLink="true">https://forum.qt.io/post/781918</guid><dc:creator><![CDATA[howerl]]></dc:creator><pubDate>Tue, 05 Dec 2023 11:55:40 GMT</pubDate></item><item><title><![CDATA[Reply to Why does calling dynamicCall and querySubObject always get an error in QAxWidget? on Tue, 05 Dec 2023 11:45:40 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> i tried the code, there is no warning again, but error generated when running, the info as follow:</p>
<p dir="auto">self.ax_widget.dynamicCall("ActiveDocument.GoTo(int)".encode('utf-8'), 10)<br />
ValueError: 'PySide6.QtAxContainer.QAxBase.dynamicCall' called with wrong argument values:<br />
PySide6.QtAxContainer.QAxBase.dynamicCall(b'ActiveDocument.GoTo(int)', 10)<br />
Found signature:<br />
PySide6.QtAxContainer.QAxBase.dynamicCall(bytes, Any = Invalid(typing.Any), Any = Invalid(typing.Any), Any = Invalid(typing.Any), Any = Invalid(typing.Any), Any = Invalid(typing.Any), Any = Invalid(typing.Any), Any = Invalid(typing.Any), Any = Invalid(typing.Any))</p>
]]></description><link>https://forum.qt.io/post/781917</link><guid isPermaLink="true">https://forum.qt.io/post/781917</guid><dc:creator><![CDATA[howerl]]></dc:creator><pubDate>Tue, 05 Dec 2023 11:45:40 GMT</pubDate></item><item><title><![CDATA[Reply to Why does calling dynamicCall and querySubObject always get an error in QAxWidget? on Tue, 05 Dec 2023 09:41:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/howerl">@<bdi>howerl</bdi></a><br />
Maybe it is only a warning as <a class="plugin-mentions-user plugin-mentions-a" href="/user/hskoglund">@<bdi>hskoglund</bdi></a> says.  But if it needs to be fixed, the message seems to be telling you that you are passing a Python <code>str</code> for the first argument but it wants a Python <code>bytes</code> type.  Try:</p>
<pre><code>self.ax_widget2.dynamicCall("ActiveDocument.GoTo(int)".encode('utf-8'), 10)
</code></pre>
<p dir="auto">?</p>
]]></description><link>https://forum.qt.io/post/781901</link><guid isPermaLink="true">https://forum.qt.io/post/781901</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Tue, 05 Dec 2023 09:41:04 GMT</pubDate></item><item><title><![CDATA[Reply to Why does calling dynamicCall and querySubObject always get an error in QAxWidget? on Tue, 05 Dec 2023 09:25:34 GMT]]></title><description><![CDATA[<p dir="auto">Hi, you're sure it's not just a warning? i.e. the call worked but resulted in a warning.</p>
]]></description><link>https://forum.qt.io/post/781898</link><guid isPermaLink="true">https://forum.qt.io/post/781898</guid><dc:creator><![CDATA[hskoglund]]></dc:creator><pubDate>Tue, 05 Dec 2023 09:25:34 GMT</pubDate></item></channel></rss>