1
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2026-03-10 10:47:49 +01:00

fix(crosshair): wip plugin for motor selections widget

This commit is contained in:
2024-05-29 10:53:16 +02:00
parent ab689a76ed
commit b140d3c9a8
5 changed files with 75 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
from selection import MotorControlSelection
from selectionplugin import MotorControlSelectionPlugin
from PySide6.QtDesigner import QPyDesignerCustomWidgetCollection
# Set PYSIDE_DESIGNER_PLUGINS to point to this directory and load the plugin
if __name__ == "__main__":
QPyDesignerCustomWidgetCollection.addCustomWidget(MotorControlSelectionPlugin())

View File

@@ -0,0 +1,4 @@
{
"files": ["selection.py", "motor_selection_launch.py", "registertictactoe.py", "tictactoeplugin.py",
"tictactoetaskmenu.py"]
}

View File

@@ -0,0 +1,58 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
from selection import MotorControlSelection
from PySide6.QtGui import QIcon
from PySide6.QtDesigner import QDesignerCustomWidgetInterface
DOM_XML = """
<ui language='c++'>
<widget class='MotorControlSelection' name='selection'>
</widget>
</ui>
"""
class MotorControlSelectionPlugin(QDesignerCustomWidgetInterface):
def __init__(self):
super().__init__()
self._form_editor = None
def createWidget(self, parent):
t = MotorControlSelection(parent)
return t
def domXml(self):
return DOM_XML
def group(self):
return ""
def icon(self):
return QIcon()
def includeFile(self):
return "selection"
def initialize(self, form_editor):
self._form_editor = form_editor
# manager = form_editor.extensionManager()
# iid = TicTacToeTaskMenuFactory.task_menu_iid()
# manager.registerExtensions(TicTacToeTaskMenuFactory(manager), iid)
def isContainer(self):
return False
def isInitialized(self):
return self._form_editor is not None
def name(self):
return "MotorControlSelection"
def toolTip(self):
return "MotorControl Selection Example for BEC Widgets"
def whatsThis(self):
return self.toolTip()