aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/doc/extras/QtDesigner.QPyDesignerCustomWidgetCollection.rst
blob: 45eec5bd58e8ad5e66ff5dccadb6956eb0bd7432 (plain)
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
PySide6.QtDesigner.QPyDesignerCustomWidgetCollection
====================================================

.. currentmodule:: PySide6.QtDesigner
.. py:class:: QPyDesignerCustomWidgetCollection

    Synopsis
    --------

    Methods
    ^^^^^^^

    .. container:: function_list

        def :meth:`registerCustomWidget`
        def :meth:`addCustomWidget`

    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`_ .

    The usage is explained in :ref:`designer_custom_widgets`.

    .. py:staticmethod:: QPyDesignerCustomWidgetCollection.registerCustomWidget(type[, xml=""[, tool_tip=""[, icon=""[, group=""[container=False]]]]])

        :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.

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

        The optional keyword arguments correspond to the getters of
        `QDesignerCustomWidgetInterface`_ :

        .. seealso::  :meth:`registerCustomWidget()<PySide6.QtUiTools.QUiLoader.registerCustomWidget>`

    .. py:staticmethod:: QPyDesignerCustomWidgetCollection.addCustomWidget(custom_widget)

        :param QDesignerCustomWidgetInterface custom_widget: Custom widget instance

        Adds a custom widget (implementation of
        `QDesignerCustomWidgetInterface`_)
        with *Qt Widgets Designer*.

.. _QDesignerCustomWidgetInterface: https://doc.qt.io/qt-6/qdesignercustomwidgetinterface.html