How can I call the const method variant on a Qt object from Python?
-
Hi,
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.
In C++ the compiler picks the correct variant of the method based on the const-ness of the object.
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.The specific Qt class I am having the issue with is QDBusArgument.
It has "void beginMapEntry()" and "void beginMapEntry() const" signatures in C++.
The non-const variant is used for marshalling objects into a QDBusArgument object.
The const variant is used for de-marshalling objects out of a QDBusArgument (what I need).Note that the QDBusArgument class has many method signatures which differ only in their const-ness.
Any insights would be appreciated!
Regards James
-
This is not possible, currently. The function would have to be added under a different name.