Config: properly handle loading bool datatype
Signed-off-by: Juraj Oravec <sgd.orava@gmail.com>
This commit is contained in:
parent
a15d214160
commit
f97ae0a02b
@ -66,7 +66,7 @@ class {{ name }}{% if base_classes %}({% for inh in base_classes %}{{ inh.baseTy
|
|||||||
|
|
||||||
settings.beginGroup("{% if settings_group_name %}{{ settings_group_name }}{% else %}{{ name }}{% endif %}")
|
settings.beginGroup("{% if settings_group_name %}{{ settings_group_name }}{% else %}{{ name }}{% endif %}")
|
||||||
{% for member in members %}
|
{% for member in members %}
|
||||||
self.{{ member.name }} = {{ member.type }}(settings.value("{{ member.name }}", self.{{ member.name }}))
|
self.{{ member.name }} = {% if member.type == "bool" %}self._{% endif %}{{ member.type }}(settings.value("{{ member.name }}", self.{{ member.name }}))
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
settings.endGroup()
|
settings.endGroup()
|
||||||
|
|
||||||
@ -118,3 +118,11 @@ class {{ name }}{% if base_classes %}({% for inh in base_classes %}{{ inh.baseTy
|
|||||||
self.{{ member.name }}Changed.emit({{ member.name }})
|
self.{{ member.name }}Changed.emit({{ member.name }})
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
|
||||||
|
{% if include_load_save %}
|
||||||
|
|
||||||
|
def _bool(self, value):
|
||||||
|
return value == "true"
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
Loading…
Reference in New Issue
Block a user