Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow passing arguments to QSettings() #3

Open
jrast opened this issue May 22, 2015 · 0 comments
Open

Allow passing arguments to QSettings() #3

jrast opened this issue May 22, 2015 · 0 comments
Assignees

Comments

@jrast
Copy link
Contributor

jrast commented May 22, 2015

It would be nice to have a option to pass arguments to the constructor of QSettings in the QSettingsManager.

I have made a quick fix for me to use a .ini file instead of the registry which looks something like this:

class IniSettingsManager(QSettingsManager):

    def __init__(self, path, defaults=None, *args, **kwargs):
        self.ini_path = path
        super(IniSettingsManager, self).__init__(defaults, *args, **kwargs)


    def reset(self):
        """
            Reset the config manager to it's initialised state.

            This initialises QSettings, unsets all defaults and removes all handlers, maps, and hooks.
        """
        self.settings = QSettings(self.ini_path, QSettings.IniFormat)
        self.handlers = {}
        self.handler_callbacks = {}
        self.defaults = {}
        self.maps = {}
        self.eventhooks = {}
@mfitzp mfitzp self-assigned this Oct 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants