<div dir="ltr">Hi all,<div><br></div><div>I am wondering what's the best way to warn the user when reading XML is not going as expected i.e. when an error is encountered.</div><div><br></div><div>Here is the path to the method I want to warn from:</div><div><br></div><div>QgsProject::read</div><div>QgsProject::readProjectFile<br></div><div>QgsProject::_getMapLayers<br></div><div>QgsProject::addLayer<br></div><div>QgsMapLayer::readLayerXML<br></div><div>QgsVectorLayer::readXML<br></div><div>QgsVectorLayer::readSymbology<br></div><div>QgsEditFormConfig::readXML<br></div><div><br></div><div>I see only two solutions:</div><div><br></div><div>1. Using success return value and some errorMessage.</div><div> This is partly done in readSymbology but totally incomplete (always returns true and errorMessage are not used at all...)</div><div>It would require a finer grain than bool as return value (info / warning / error, probably).</div><div>It would probably be a a list of error messages.</div><div> <br></div><div>2. Emitting signals.</div><div>But that means bring the connections all the way up to the project by connecting and disconnecting the map layers and all other objects during the way down. Moreover, many config object are not QObjects.</div><div><br></div><div>To me solution 1. sounds nicer but is an API break. </div><div>The small feature I am working on is targeted to 3.2 si I would need to set this in place prior to release.</div><div><br></div><div>Is there somehting I am missing?</div><div><br></div><div>Cheers,</div><div>Denis</div><div><br></div><div><br></div></div>