mirror of
https://github.com/bec-project/bec_widgets.git
synced 2026-04-19 23:05:36 +02:00
55 lines
1.2 KiB
Plaintext
55 lines
1.2 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.QtGui import QIcon
|
|
|
|
{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):
|
|
t = {plugin_name_pascal}(parent)
|
|
return t
|
|
|
|
def domXml(self):
|
|
return DOM_XML
|
|
|
|
def group(self):
|
|
return ""
|
|
|
|
def icon(self):
|
|
return QIcon()
|
|
|
|
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()
|