'Save the geometry when closed.'

def closeEvent(self, e):

    state_config = objreg.get('state-config')
    data = bytes(self.saveGeometry())
    geom = base64.b64encode(data).decode('ASCII')
    state_config['geometry']['inspector'] = geom
    super().closeEvent(e)
