mirror of
https://github.com/bec-project/bec_widgets.git
synced 2026-03-05 00:12:49 +01:00
60 lines
1.3 KiB
Python
60 lines
1.3 KiB
Python
# Copyright (C) 2022 The Qt Company Ltd.
|
|
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
|
import os
|
|
|
|
from qtpy.QtDesigner import QDesignerCustomWidgetInterface
|
|
from qtpy.QtGui import QIcon
|
|
|
|
import bec_widgets
|
|
from bec_widgets.widgets.bec_queue.bec_queue import BECQueue
|
|
|
|
DOM_XML = """
|
|
<ui language='c++'>
|
|
<widget class='BECQueue' name='bec_queue'>
|
|
</widget>
|
|
</ui>
|
|
"""
|
|
|
|
MODULE_PATH = os.path.dirname(bec_widgets.__file__)
|
|
|
|
|
|
class BECQueuePlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
|
def __init__(self):
|
|
super().__init__()
|
|
self._form_editor = None
|
|
|
|
def createWidget(self, parent):
|
|
t = BECQueue(parent)
|
|
return t
|
|
|
|
def domXml(self):
|
|
return DOM_XML
|
|
|
|
def group(self):
|
|
return "BEC Services"
|
|
|
|
def icon(self):
|
|
icon_path = os.path.join(MODULE_PATH, "assets", "designer_icons", "device_line_edit.png")
|
|
return QIcon(icon_path)
|
|
|
|
def includeFile(self):
|
|
return "bec_queue"
|
|
|
|
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 "BECQueue"
|
|
|
|
def toolTip(self):
|
|
return "Widget to display the BEC queue."
|
|
|
|
def whatsThis(self):
|
|
return self.toolTip()
|