diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-02-16 18:21:39 +0100 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-02-23 18:15:17 +0100 |
| commit | f914137757ad478e125f9d076bdeaef0f8428e8f (patch) | |
| tree | 6b767ff958e6c004d8fd163b56425165e9247045 /sources/pyside6/doc/extras/QtDesigner.QPyDesignerCustomWidgetCollection.rst | |
| parent | 28f76593fa6177a3a97fd308f0404529a7337169 (diff) | |
Add further documentation on the Qt Designer plugin
Document the QPy*Extension base classes and functions
of QPyDesignerCustomWidgetCollection.
Task-number: PYSIDE-1455
Change-Id: I3874058ed50475a418be3becbeb22ad94066dca5
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/pyside6/doc/extras/QtDesigner.QPyDesignerCustomWidgetCollection.rst')
| -rw-r--r-- | sources/pyside6/doc/extras/QtDesigner.QPyDesignerCustomWidgetCollection.rst | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/sources/pyside6/doc/extras/QtDesigner.QPyDesignerCustomWidgetCollection.rst b/sources/pyside6/doc/extras/QtDesigner.QPyDesignerCustomWidgetCollection.rst new file mode 100644 index 000000000..00260860b --- /dev/null +++ b/sources/pyside6/doc/extras/QtDesigner.QPyDesignerCustomWidgetCollection.rst @@ -0,0 +1,52 @@ +.. currentmodule:: PySide6.QtDesigner +.. _QPyDesignerCustomWidgetCollection: + +QPyDesignerCustomWidgetCollection +********************************* + +Synopsis +-------- + +Functions +^^^^^^^^^ + ++------------------------------------------------------------------------------------------------+ +|def :meth:`registerCustomWidget<QPyDesignerCustomWidgetCollection.registerCustomWidget>` (type) | ++------------------------------------------------------------------------------------------------+ +|def :meth:`addCustomWidget<QPyDesignerCustomWidgetCollection.addCustomWidget>` (custom_widget) | ++------------------------------------------------------------------------------------------------+ + +Detailed Description +-------------------- + + The :class:`~.QPyDesignerCustomWidgetCollection` implements + `QDesignerCustomWidgetCollectionInterface <https://doc.qt.io/qt-6/qdesignercustomwidgetcollectioninterface.html>`_ + and provides static helper functions for registering custom widgets by + type or by implementing + `QDesignerCustomWidgetInterface <https://doc.qt.io/qt-6/qdesignercustomwidgetinterface.html>`_ . + + The usage is explained in :ref:`designer_custom_widgets`. + +.. py:staticmethod:: 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 <https://doc.qt.io/qt-6/qdesignercustomwidgetinterface.html>`_ : + + :param str xml: A snippet of XML code in ``.ui`` format that specifies how the widget is created and sets initial property values. + :param str tool_tip: Tool tip to be shown in the widget box. + :param str icon: Path to an icon file be shown in the widget box. + :param str group: Category for grouping widgets in the widget box. + :param str module: Module name for generating the import code by `uic <https://doc.qt.io/qt-6/uic.html>`_ . + :param bool container: Indicates whether the widget is a container like `QGroupBox`, that is, child widgets can be placed on it. + + .. seealso:: :meth:`registerCustomWidget()<PySide6.QtUiTools.QUiLoader.registerCustomWidget>` + +.. py:staticmethod:: QPyDesignerCustomWidgetCollection.addCustomWidget(custom_widget) + + Adds a custom widget (implementation of + `QDesignerCustomWidgetInterface <https://doc.qt.io/qt-6/qdesignercustomwidgetinterface.html>`_) + with Qt Designer. + + :param QDesignerCustomWidgetInterface custom_widget: Custom widget instance |
