Store and restore viewer state and geometry via QSettings