<div dir="ltr"><div><div><div><div><div>Hi,<br><br></div>I was investigating a new bug when editing a feature's attribute with the current master.<br></div>For example, if you don't touch the configuration of a layer containing integer fields, save the project, exit, re-open the project, when you edit the attribute of this layer, all the integer fields are forced to 0.<br><br></div>The problem must come from a different behavior with Qt5. Before, the field config for text was saved like that:<br><font size="1"><span style="font-family:monospace,monospace"><widgetv2config AllowNull="0" labelOnTop="0" fieldEditable="1" notNull="0"/></span></font><br><br></div>Now, it's saved like that:<br><font size="1"><span style="font-family:monospace,monospace"><widgetv2config Style="" Min="" AllowNull="0" labelOnTop="0" 
constraintDescription="" fieldEditable="1" notNull="0" Max="" Step="" 
constraint=""/></span></font><br><br></div>See? All the non-boolean fields that are not specified are now there with an empty value.<br><br>My guess is that QDomElement::setAttribute was a no-op for QString::null and now it adds an attribute with an empty string. I don't know. But it's a mess now. Code in the QgsEditorWrapper will end up not using default values when they do stuff like:<br><div><div><font size="1"><span style="font-family:monospace,monospace">const QString displayFormat = config( "display_format", QgsDateTimeEditConfig::defaultFormat( field().type() ) ).toString();</span></font><br><br></div><div>The config entry being always there, but empty when not specified, the default will never be taken. It's then same for range widget's min and max values then ends up being 0 (my original bug).<br><br></div><div>And I'm afraid the edit widgets are not the only ones suffering from those problems.<br><br></div><div>Am I the only one seeing that? What do we do, now?<br><br></div><div>Thanks<br></div></div></div>