Instance settings can't get restored (rqt)
Hey guys,
I am writing a rqt plugin in python and want to restore my settings (which check box was checked for example) through instance settings like a lot of people did in their plugins but it does not work. When I try to print the value I always get 'None'.
In "save_settings" I am writing:
"instancesettings.setvalue('checkbox', self.ui.checkbox.isChecked())"
and in "restore settings":
"self.ui.checkbox.setChecked(instancesettings.value('check_box', True) in [True, 'true'])"
The problem is that my value never gets saved. It always stays True for example.
I don't really understand the value function so I looked up the code in "qtguiplugin" and afterwards the documentation of the QSettings value function and I still don't know why it does not work.
Maybe someone can help me with this, would be really appreciated!
Thank you in advance!
Best regards
Asked by ce_guy on 2017-02-27 04:50:41 UTC
Comments
It seems to work in other plugins (e.g. https://github.com/ros-visualization/rqt_common_plugins/blob/c7780f510df2026566faddcb94333e88cb9def32/rqt_plot/src/rqt_plot/plot.py#L120-L125). You might want to share your code so that others can take a closer look at it,
Asked by Dirk Thomas on 2017-02-27 11:12:40 UTC