Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QDataWidgetMapper and QPushButton
I would like to store the state of a "checkable" QPushButton in the QDataWidgetMapper model. I tried adding code as follows but it doesn't do anything.
mapper.addMapping(checkBtn, 0, b'checked')
On checking or unchecking the button, data in the model remains unchanged.
I can't test right now but are you sure you should not be using a str rather than a bytes variable ?
Can you provide a minimal example that shows that behaviour ?
@SGaist Actually it works. I'm resolving this issue. I had made some errors in mapping to the right section.
Then since you have it working now, please mark the thread as solved so other forum users may know a solution has been found :-)
Denni 0 Banned last edited by
Also when you post it solved -- providing the solution you found would be great too :)