[xsd-users] Assignment of optional boolean attribute does not survive on the heap; possibly a bug?

Andreas.Hackeloeer at bmw.de Andreas.Hackeloeer at bmw.de
Wed Jun 26 09:06:54 EDT 2013


Hi Boris and Erik,

I finally found the solution. Sorry for bothering you - the reason didn't have anything to do with CodeSynthesis XSD, as it turned out.

I have a Qt UI which fills a combo box with the Map elements found in the XML. In the second method which is called by the first one, I call a clear() on the combo box beforehand. However, I registered an event handler on the currentIndexChanged() event ("signal" in Qt terminology) which gets fired when the user changes the current item, but appearently also when you do a clear() programmatically, which I was not aware of. Within this event handler, I changed the selectedSourceMap attribute of the XML representation to match with the currently selected item (but not the Title attribute, which is why this remained the same). The obvious solution is to disable the event handler before calling clear(). Then, the selectedSourceMap attribute behaves as it is supposed to.

I did not quote the Qt stuff because I thought it was irrelevant to the problem. Sorry for that. And thanks a lot for time and your advice!

Best regards,
Andreas



More information about the xsd-users mailing list