mirror of
https://github.com/bec-project/bec_widgets.git
synced 2026-04-19 23:05:36 +02:00
58 lines
1.3 KiB
Plaintext
58 lines
1.3 KiB
Plaintext
# Copyright (C) 2022 The Qt Company Ltd.
|
|
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
|
|
|
from qtpy.QtDesigner import QDesignerCustomWidgetInterface
|
|
from qtpy.QtWidgets import QWidget
|
|
|
|
from bec_widgets.utils.bec_designer import designer_material_icon
|
|
{widget_import}
|
|
|
|
DOM_XML = """
|
|
<ui language='c++'>
|
|
<widget class='{plugin_name_pascal}' name='{plugin_name_snake}'>
|
|
</widget>
|
|
</ui>
|
|
"""
|
|
|
|
|
|
class {plugin_name_pascal}Plugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
|
def __init__(self):
|
|
super().__init__()
|
|
self._form_editor = None
|
|
|
|
def createWidget(self, parent):
|
|
if parent is None:
|
|
return QWidget()
|
|
t = {plugin_name_pascal}(parent)
|
|
return t
|
|
|
|
def domXml(self):
|
|
return DOM_XML
|
|
|
|
def group(self):
|
|
return ""
|
|
|
|
def icon(self):
|
|
return designer_material_icon({plugin_name_pascal}.ICON_NAME)
|
|
|
|
def includeFile(self):
|
|
return "{plugin_name_snake}"
|
|
|
|
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 "{plugin_name_pascal}"
|
|
|
|
def toolTip(self):
|
|
return "{plugin_tooltip}"
|
|
|
|
def whatsThis(self):
|
|
return self.toolTip()
|