• Source
    1. #!/usr/bin/env python
    2.  
    3. from ngl_utils.nplugins.python.ngl_base_qplugin import NGL_BasePlugin
    4. from ngl_greed import NGL_Greed
    5.  
    6.  
    7. class NGL_GreedPlugin(NGL_BasePlugin):
    8. """NGL_GreedPlugin(NGL_BasePlugin)
    9.  
    10. Provides a Python custom plugin for Qt Designer by implementing the
    11. QDesignerCustomWidgetPlugin via a PyQt-specific custom plugin class.
    12. """
    13.  
    14. # This factory method creates new instances of custom widget with the
    15. # appropriate parent.
    16. def createWidget(self, parent):
    17. widget = NGL_Greed(parent)
    18. return widget
    19.  
    20. # This method returns the name of the custom widget class that is provided
    21. # by this plugin.
    22. def name(self):
    23. return "NGL_Greed"
    24.  
    25. # Returns the name of the group in Qt Designer's widget box that this
    26. # widget belongs to.
    27. def group(self):
    28. return "NGL Widgets"
    29.  
    30. # Returns an XML description of a custom widget instance that describes
    31. def domXml(self):
    32. return '<widget class="NGL_Greed" name="nglGreed" />\n'
    33.  
    34. # Returns the module containing the custom widget class. It may include
    35. # a module path.
    36. def includeFile(self):
    37. return ".ngl_greed"
    38.