properties as setter/getter methods line in PySide
Dynamic Python binding for Qt Applications
Brought to you by:
florianlink,
marcusbarann
Hi,
is it possible to change the properties access to setter/getter methods like in PySide? Actually right now only the getter methods are missing. I would like to write "QString name = lineedit->text()" instead of "QString name = lineedit->text". Is this easily possible? When yes any hints what needs to be changed in the code.
Regards,
Andreas
Yes, you have to change the order of slot vs property lookup in the PythonQtClassInfo.cpp
You might need to adjust PythonQtInstanceWrapper get_attr and set_attr, but maybe that even works without changes.
Hi Florian,
many thanks for the hint. Just changed the lookup order in PythonQtClassInfo::member() and it works fine :-)
Regards,
Andreas