Skip to content

Instantly share code, notes, and snippets.

@LeftRadio
Created December 6, 2015 01:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LeftRadio/fc44492838d3fc94fe46 to your computer and use it in GitHub Desktop.
Save LeftRadio/fc44492838d3fc94fe46 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
from ngl_utils.nplugins.python.ngl_base_qplugin import NGL_BasePlugin
from ngl_greed import NGL_Greed
class NGL_GreedPlugin(NGL_BasePlugin):
"""NGL_GreedPlugin(NGL_BasePlugin)
Provides a Python custom plugin for Qt Designer by implementing the
QDesignerCustomWidgetPlugin via a PyQt-specific custom plugin class.
"""
# This factory method creates new instances of custom widget with the
# appropriate parent.
def createWidget(self, parent):
widget = NGL_Greed(parent)
return widget
# This method returns the name of the custom widget class that is provided
# by this plugin.
def name(self):
return "NGL_Greed"
# Returns the name of the group in Qt Designer's widget box that this
# widget belongs to.
def group(self):
return "NGL Widgets"
# Returns an XML description of a custom widget instance that describes
def domXml(self):
return '<widget class="NGL_Greed" name="nglGreed" />\n'
# Returns the module containing the custom widget class. It may include
# a module path.
def includeFile(self):
return ".ngl_greed"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment