QPyDesignerCustomWidgetCollection#

Synopsis#

Functions#

def registerCustomWidget (type)

def addCustomWidget (custom_widget)

Detailed Description#

The QPyDesignerCustomWidgetCollection implements QDesignerCustomWidgetCollectionInterface and provides static helper functions for registering custom widgets by type or by implementing QDesignerCustomWidgetInterface .

The usage is explained in Custom Widgets in Qt Designer.

static QPyDesignerCustomWidgetCollection.registerCustomWidget(type[, xml=""[, tool_tip=""[, icon=""[, group=""[container=False]]]]])#

Registers an instance of a Python-implemented QWidget by type with Qt Designer.

The optional keyword arguments correspond to the getters of QDesignerCustomWidgetInterface :

Parameters:
  • xml (str) – A snippet of XML code in .ui format that specifies how the widget is created and sets initial property values.

  • tool_tip (str) – Tool tip to be shown in the widget box.

  • icon (str) – Path to an icon file be shown in the widget box.

  • group (str) – Category for grouping widgets in the widget box.

  • module (str) – Module name for generating the import code by uic .

  • container (bool) – Indicates whether the widget is a container like QGroupBox, that is, child widgets can be placed on it.

See also

registerCustomWidget()

static QPyDesignerCustomWidgetCollection.addCustomWidget(custom_widget)#

Adds a custom widget (implementation of QDesignerCustomWidgetInterface) with Qt Designer.

Parameters:

custom_widget (QDesignerCustomWidgetInterface) – Custom widget instance