Skip to content

Commit 9b1da51

Browse files
committed
Fix widget activation logic to handle None at init
1 parent f8225fd commit 9b1da51

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

guidata/dataset/qtitemwidgets.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,11 @@ def set_state(self) -> None:
183183
"""Update the visual status of the widget and enables/disables the widget if
184184
necessary"""
185185
active = self.is_active()
186-
if self.group:
187-
self.group.setEnabled(active)
188-
if self.label:
189-
self.label.setEnabled(active)
186+
if active is not None:
187+
if self.group:
188+
self.group.setEnabled(active)
189+
if self.label:
190+
self.label.setEnabled(active)
190191

191192
def notify_value_change(self) -> None:
192193
"""Notify parent layout that widget value has changed"""

0 commit comments

Comments
 (0)