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

no conversion with QSettingManager #2

Open
ghislainp opened this issue Feb 26, 2015 · 0 comments
Open

no conversion with QSettingManager #2

ghislainp opened this issue Feb 26, 2015 · 0 comments
Assignees

Comments

@ghislainp
Copy link

Reagrding: "Note: On some platforms, versions of Qt, or Qt APIs QSettings will return strings for all values which can lead to complicated code and breakage. However, PyQtConfig is smart enough to use the type of the config parameter in defaults to auto-convert returned values.
However, you do not have to set defaults manually. As of v0.7 default values are auto-set when attaching widgets (handlers) to the config manager if they're not already set."

Using QSpinBox, it seems that when no default was defined, no conversion is done and a string is send to the setValue which raise an exception. My QSpinBox is created via qtdesigner.

from acquisition_gui import Ui_acquisitionDockWidget
self.ui = Ui_acquisitionDockWidget()
self.ui.setupUi(self)

self.settings = QSettingsManager()        self.settings.add_handler("acquisition/record_interval",self.ui.record_interval_spinBox)
      self.settings.add_handler("acquisition/number_records",self.ui.number_records_spinBox)
@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