Unsolved 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.
-
Hi,
I can't test right now but are you sure you should not be using a str rather than a bytes variable ?
-
@SGaist I have tried str and byte for push button. For combobox i use bytes and don't have a problem. Works fine. Also used bytes as Pyside Documentation specified using PySide.QtCore.QByteArray
-
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.
-
Great !
Then since you have it working now, please mark the thread as solved so other forum users may know a solution has been found :-)