BoF on Qt for Python by @anupambasak27 starting in 1 hour
https://meet.kde.org/b/akademy-bof-1
23 June 2021
Hi!
Does someone maybe know how to avoid normalizing of function arguments in shiboken6? I try to make a binding for function(constructor) with signature Query(const std::initializer_list<QPair<QString, QString>>& l). It transforms first QPair to std::pair and I get an error, because there is no constructor with signature Query(const std::initializer_list<std::pair<QString, QString>>& l) .
I tried to avoid that by using <modify-argument>:
<modify-argument index="1">
<replace-type modified-type="std::initializer_list<QPair<QString, QString>>" />
</modify-argument>
Unfortunately it has no effect.
The modify-argument + replace-type is limited to the few cases we have discovered in the Qt API, so I'd not expect to work in that regard, mainly because there is no way to handle an expression with a std::initializer_list, inside the typesystem for Qt Core you can see a : <rejection class="*" argument-type="^std::initializer_list<.*$"/>, meaning pyside doesn't support it.
I think the only solution will be for you to create your own replace-type functions, or create a different signature for 'Query' that accept something else, and internally call the constructor with the initializer_list<QPair.....
Cristián 🥑The modify-argument + replace-type is limited to the few cases we have discovered in the Qt API, so I'd not expect to work in that regard, mainly because there is no way to handle an expression with a std::initializer_list, inside the typesystem for Qt Core you can see a : <rejection class="*" argum
Thanks for reply! I'll open a user story.
Welcome RaXa 🎉 🎊
Verify you are not a bot solving the captcha!
Remember to check the documentation page https://doc.qt.io/qtforpython/ and the wiki https://pyside.org if you have some questions.