Persist directory chosen

Hi! I was wondering, what is the best way to persist (after closing Slicer) the directory a user has chosen in a module I am creating. I initially thought about saving this information in and ended asking here because maybe there is some utility function to do this kind of thing.


I believe you have access to QSettings. You could use that with a well chosen prefix to save intersession values.

This is for users who don’t save their scenes. If you have users who save scenes, the module data should be baked into a MRML node of your creation (not as bad as you think).

1 Like

Thanks Adam, the first solution is what I wanted.