Open stlehmann opened 9 years ago
Thanks for this :+1: Do you know how that value ended up in there?
It probably makes sense to wrap this further up (in the manager itself) so it works for all widgets in case of error. Also worth raising a warning that the set has failed so it shows up in logs.
I'll take a look :)
I have no idea how it ended up there. I was playing around with the code of my application a bit but I can' t remember. However it is easily possible that a setting gets corrupted somehow, e.g. by direct manipulation via set()
. So it definetly makes sense to wrap it up in the manager for other widgets as well. Returning the default value in case of an error would make sense to me.
:+1: for warning in logs.
Just had the rare case of having corrupt data in one of my settings. In this specific case it was the mapping of QButtonGroup where the default value is something like
[[0, True], [1, False], [2, False]]
. But somehow I managed to save[None, [None]]
as my settings value. Now everytime I try to add the handler for my ButtonGroup I get following error:The only way I could help myself was to use another name for the setting. As the exception occurs in __setQButtonGroup I thought about wrapping it in a
try ... except
right there.