<?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[How can I call the const method variant on a Qt object from Python?]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I'm trying to use a Qt API from PySide6 that has two overloaded methods with the same C++ signature except for the const specifier.<br />
In C++ the compiler picks the correct variant of the method based on the const-ness of the object.<br />
But Python doesn't have const objects so I am trying to figure out is there another way to call the const variant of the method as the non-const method doesn't do what I need and Python seems to always call this variant.</p>
<p dir="auto">The specific Qt class I am having the issue with is QDBusArgument.<br />
It has "void beginMapEntry()" and "void beginMapEntry() const" signatures in C++.<br />
The non-const variant is used for marshalling objects into a QDBusArgument object.<br />
The const variant is used for de-marshalling objects out of a QDBusArgument (what I need).</p>
<p dir="auto">Note that the QDBusArgument class has many method signatures which differ only in their const-ness.</p>
<p dir="auto">Any insights would be appreciated!</p>
<p dir="auto">Regards James</p>
]]></description><link>https://forum.qt.io/topic/163670/how-can-i-call-the-const-method-variant-on-a-qt-object-from-python</link><generator>RSS for Node</generator><lastBuildDate>Mon, 04 May 2026 12:12:17 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/163670.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 07 Nov 2025 10:02:18 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How can I call the const method variant on a Qt object from Python? on Fri, 07 Nov 2025 21:20:05 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for clarifying.  I suspected this would be the case but I thought it was worth asking the question.</p>
]]></description><link>https://forum.qt.io/post/833426</link><guid isPermaLink="true">https://forum.qt.io/post/833426</guid><dc:creator><![CDATA[kellyjp]]></dc:creator><pubDate>Fri, 07 Nov 2025 21:20:05 GMT</pubDate></item><item><title><![CDATA[Reply to How can I call the const method variant on a Qt object from Python? on Fri, 07 Nov 2025 20:35:22 GMT]]></title><description><![CDATA[<p dir="auto">This is not possible, currently. The function would have to be added under a different name.</p>
]]></description><link>https://forum.qt.io/post/833424</link><guid isPermaLink="true">https://forum.qt.io/post/833424</guid><dc:creator><![CDATA[friedemannkleint]]></dc:creator><pubDate>Fri, 07 Nov 2025 20:35:22 GMT</pubDate></item></channel></rss>