modify-function sometimes does not work
Dynamic Python binding for Qt Applications
Brought to you by:
florianlink,
marcusbarann
Hey Florian,
i have a strange problem with <modify-function>, sometimes it does not work.
f.e.
With some classes this works, but for some other classes it does not work. The only workaround i have found is to use the <rejection> directive before.
The example above is a stripped down version. I have multiple removes in the same class. When i use the rejection method, i have to write my class name over and over again.
Do you have any idea why this happen?
I've tried to find the problem in the code but i'm not 100% sure where the rejection happens.
I've use the latest truk version of pythonqt.
Thx in advance
Tonka
Hm, the class system is basically the original code from the QtScript generator. The rejection only matches the method name and even supports asterix. The modify function is very picky, you have to write the function name exactly like the class parser has seen it, I had trouble with the correct writing as well...
Ok. Do you now a good trick how i can print out (f.e. stdout) how the parser see the function definition?
I remember that I added a comment somewhere to print functions as the parser sees it, but I don't remember where, maybe look for commented couts...
I think it would make sense to add an option to modify function that only matches by name, not by full signature or a remove-function tag. Maybe you can do that? If you grep for the xml tags you should find the place in the code easily.
That make sense. If i find some time i will do it.
At the moment i have some troubles with export macro as modifier on a methods, it seems that PythonQt will fallback to it's class-name as return value if there is a export macro in front of it.
Last edit: Tonka 2017-04-13