<div dir="ltr">Hey all,<div><br></div><div>Just thought I would make everyone aware of a quick time saver for restoring dialog/widget positions added in master.  This is mainly to remove the pain of having to do restoreGeometry()/saveGeometry() in every widget and remembering the naming we use for settings keys.  It's also about fixing consistency inside the application so every dialog remembers their state correctly.<br></div><div><br></div><div>The new API is:</div><div><br></div><div><div>  QgsGui::instance()->enableAutoGeometryRestore( this );</div></div><div><br></div><div>This should go just after   setupUi( this );</div><div><br></div><div>Here is an example:</div><div><a href="goog_1212792088"><br></a></div><div><a href="https://github.com/qgis/QGIS/blob/master/src/gui/qgsexpressionbuilderdialog.cpp#L26">https://github.com/qgis/QGIS/blob/master/src/gui/qgsexpressionbuilderdialog.cpp#L26</a><br></div><div><br></div><div>You can then remove any calls to restoreGeometry() and saveGeometry() in your widget. Diff of an example:</div><div><a href="goog_1212792089"><br></a></div><div><a href="https://github.com/qgis/QGIS/commit/57dc9deb06a8f4474429b2956008188292588a1b#diff-b4d61d74d8a5b5319106d746b54d378bL21">https://github.com/qgis/QGIS/commit/57dc9deb06a8f4474429b2956008188292588a1b#diff-b4d61d74d8a5b5319106d746b54d378bL21</a><br></div><div><br></div><div>Unless there is a good reason not, all new widgets should be using this code when you write them. I would like to ask if people can start to port existing widgets if they are already editing that code.  I will be doing a bulk update when I can but I suspect I will miss some and group effort is better in case I run out of time.</div><div><br></div><div>Regards,</div><div>Nathan</div><div><br></div><div><br></div><div><br></div></div>