1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
#!/usr/bin/env python3
from PyQt5.QtGui import QIcon, QPixmap
from PyQt5.QtDesigner import QPyDesignerCustomWidgetPlugin
from qtvcp.widgets.overlay_widget import FocusOverlay
from qtvcp.widgets.qtvcp_icons import Icon
ICON = Icon()
class FocusOverlayPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(FocusOverlayPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, core):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return FocusOverlay(parent)
def name(self):
return "FocusOverlay"
def group(self):
return "Linuxcnc - HAL"
def icon(self):
return QIcon(QPixmap(ICON.get_path('focusoverlay')))
def toolTip(self):
return ""
def whatsThis(self):
return ""
def isContainer(self):
return True
# Returns an XML description of a custom widget instance that describes
# default values for its properties. Each custom widget created by this
# plugin will be configured using this description.
def domXml(self):
return '<widget class="FocusOverlay" name="focusoverlay" />\n'
def includeFile(self):
return "qtvcp.widgets.overlay_widget"
|