diff --git a/bec_widgets/qt_utils/widget_io.py b/bec_widgets/qt_utils/widget_io.py index 6220fc4c..d99714d3 100644 --- a/bec_widgets/qt_utils/widget_io.py +++ b/bec_widgets/qt_utils/widget_io.py @@ -9,6 +9,7 @@ from PyQt5.QtWidgets import ( QTableWidgetItem, QVBoxLayout, QCheckBox, + QLabel, ) from abc import ABC, abstractmethod @@ -77,6 +78,14 @@ class CheckBoxHandler(WidgetHandler): widget.setChecked(value) +class LabelHandler(WidgetHandler): + def get_value(self, widget): + return widget.text() + + def set_value(self, widget, value): + widget.setText(value) + + class WidgetIO: """Public interface for getting and setting values using handler mapping""" @@ -87,6 +96,7 @@ class WidgetIO: QSpinBox: SpinBoxHandler, QDoubleSpinBox: SpinBoxHandler, QCheckBox: CheckBoxHandler, + QLabel: LabelHandler, } @staticmethod