diff --git a/bec_widgets/widgets/scan_control/register_scan_control.py b/bec_widgets/widgets/scan_control/register_scan_control.py new file mode 100644 index 00000000..137528fa --- /dev/null +++ b/bec_widgets/widgets/scan_control/register_scan_control.py @@ -0,0 +1,15 @@ +def main(): # pragma: no cover + from qtpy import PYSIDE6 + + if not PYSIDE6: + print("PYSIDE6 is not available in the environment. Cannot patch designer.") + return + from PySide6.QtDesigner import QPyDesignerCustomWidgetCollection + + from bec_widgets.widgets.scan_control.scan_control_plugin import ScanControlPlugin + + QPyDesignerCustomWidgetCollection.addCustomWidget(ScanControlPlugin()) + + +if __name__ == "__main__": # pragma: no cover + main() diff --git a/bec_widgets/widgets/scan_control/scan_control.pyproject b/bec_widgets/widgets/scan_control/scan_control.pyproject new file mode 100644 index 00000000..dbbfb9cd --- /dev/null +++ b/bec_widgets/widgets/scan_control/scan_control.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["scan_control.py","scan_control_box.py"] +} diff --git a/bec_widgets/widgets/scan_control/scan_control_plugin.py b/bec_widgets/widgets/scan_control/scan_control_plugin.py new file mode 100644 index 00000000..69255bb6 --- /dev/null +++ b/bec_widgets/widgets/scan_control/scan_control_plugin.py @@ -0,0 +1,51 @@ +from qtpy.QtDesigner import QDesignerCustomWidgetInterface +from qtpy.QtGui import QIcon + +from bec_widgets.widgets.scan_control import ScanControl + +DOM_XML = """ + + + + +""" + + +class ScanControlPlugin(QDesignerCustomWidgetInterface): # pragma: no cover + def __init__(self): + super().__init__() + self._form_editor = None + + def createWidget(self, parent): + t = ScanControl(parent) + return t + + def domXml(self): + return DOM_XML + + def group(self): + return "" + + def icon(self): + return QIcon() + + def includeFile(self): + return "scan_control" + + def initialize(self, form_editor): + self._form_editor = form_editor + + def isContainer(self): + return False + + def isInitialized(self): + return self._form_editor is not None + + def name(self): + return "ScanControl" + + def toolTip(self): + return "ScanControl widget" + + def whatsThis(self): + return self.toolTip()