diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-12-20 12:26:28 +0100 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-12-21 10:54:38 +0100 |
| commit | b55e221464c18053fa44f18132071ebdaee8f432 (patch) | |
| tree | 4783c89d838f881ce18cdad076380e1777ac4653 /sources/pyside6/doc/extras | |
| parent | 59092f948048f6c014efbdaf4e94837df0a24961 (diff) | |
Document QtQml's global function as functions
Replace the extra documents (which get generated into the class list)
by function documentation snippets, so that they
show up correctly under "Global functions".
Task-number: PYSIDE-1106
Change-Id: I6a5c457669f7f1db1f572f131721dc443a7d5c70
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Diffstat (limited to 'sources/pyside6/doc/extras')
4 files changed, 0 insertions, 150 deletions
diff --git a/sources/pyside6/doc/extras/QtQml.qmlRegisterSingletonInstance.rst b/sources/pyside6/doc/extras/QtQml.qmlRegisterSingletonInstance.rst deleted file mode 100644 index 19d59893e..000000000 --- a/sources/pyside6/doc/extras/QtQml.qmlRegisterSingletonInstance.rst +++ /dev/null @@ -1,25 +0,0 @@ -.. currentmodule:: PySide6.QtQml -.. _qmlRegisterSingletonInstance: - -qmlRegisterSingletonInstance -**************************** - -.. py:function:: qmlRegisterSingletonInstance(pytype: type,\ - uri: str,\ - versionMajor: int,\ - versionMinor: int,\ - typeName: str,\ - instanceObject: object) -> int - - :param type pytype: Python class - :param str uri: uri to use while importing the component in QML - :param int versionMajor: major version - :param int versionMinor: minor version - :param str typeName: name exposed to QML - :param object instanceObject: singleton object to be registered - :return: int (the QML type id) - - This function registers a singleton Python object *instanceObject*, with a particular *uri* and - *typeName*. Its version is a combination of *versionMajor* and *versionMinor*. - - Use this function to register an object of the given type *pytype* as a singleton type. diff --git a/sources/pyside6/doc/extras/QtQml.qmlRegisterSingletonType.rst b/sources/pyside6/doc/extras/QtQml.qmlRegisterSingletonType.rst deleted file mode 100644 index 32231a391..000000000 --- a/sources/pyside6/doc/extras/QtQml.qmlRegisterSingletonType.rst +++ /dev/null @@ -1,46 +0,0 @@ -.. currentmodule:: PySide6.QtQml -.. _qmlRegisterSingletonType: - -qmlRegisterSingletonType -************************ - -.. py:function:: qmlRegisterSingletonType(pytype: type, uri: str, versionMajor: int, versionMinor: int, typeName: str) -> int - - :param type pytype: Python class - :param str uri: uri to use while importing the component in QML - :param int versionMajor: major version - :param int versionMinor: minor version - :param str typeName: name exposed to QML - :return: int (the QML type id) - - This function registers a Python type as a singleton in the QML system. - - Alternatively, the :ref:`QmlSingleton` decorator can be used. - -.. py:function:: qmlRegisterSingletonType(pytype: type, uri: str, versionMajor: int, versionMinor: int, typeName: str, callback: object) -> int - - :param type pytype: Python class - :param str uri: uri to use while importing the component in QML - :param int versionMajor: major version - :param int versionMinor: minor version - :param str typeName: name exposed to QML - :param object callback: Python callable (to handle Python type) - :return: int (the QML type id) - - This function registers a Python type as a singleton in the QML system using - the provided callback (which gets a QQmlEngine as a parameter) to generate - the singleton. - - -.. py:function:: qmlRegisterSingletonType(uri: str, versionMajor: int, versionMinor: int, typeName: str, callback: object) -> int - - :param str uri: uri to use while importing the component in QML - :param int versionMajor: major version - :param int versionMinor: minor version - :param str typeName: name exposed to QML - :param object callback: Python callable (to handle QJSValue) - :return: int (the QML type id) - - This function registers a QJSValue as a singleton in the QML system using - the provided callback (which gets a QQmlEngine as a parameter) to - generate the singleton. diff --git a/sources/pyside6/doc/extras/QtQml.qmlRegisterType.rst b/sources/pyside6/doc/extras/QtQml.qmlRegisterType.rst deleted file mode 100644 index 079e15bf1..000000000 --- a/sources/pyside6/doc/extras/QtQml.qmlRegisterType.rst +++ /dev/null @@ -1,41 +0,0 @@ -.. currentmodule:: PySide6.QtQml -.. _qmlRegisterType: - -qmlRegisterType -*************** - -.. py:function:: qmlRegisterType(pytype: type, uri: str, versionMajor: int, versionMinor: int, qmlName: str) -> int - - :param type pytype: Python class - :param str uri: uri to use while importing the component in QML - :param int versionMajor: major version - :param int versionMinor: minor version - :param str qmlName: name exposed to QML - :return: int (the QML type id) - - This function registers the Python *type* in the QML system with the - name *qmlName*, in the library imported from *uri* having the - version number composed from *versionMajor* and *versionMinor*. - - For example, this registers a Python class 'MySliderItem' as a QML - type named 'Slider' for version '1.0' of a module called - 'com.mycompany.qmlcomponents': - - :: - - qmlRegisterType(MySliderItem, "com.mycompany.qmlcomponents", 1, 0, "Slider") - - Once this is registered, the type can be used in QML by importing - the specified module name and version number: - - :: - - import com.mycompany.qmlcomponents 1.0 - - Slider { ... } - - Note that it's perfectly reasonable for a library to register types - to older versions than the actual version of the library. - Indeed, it is normal for the new library to allow QML written to - previous versions to continue to work, even if more advanced - versions of some of its types are available. diff --git a/sources/pyside6/doc/extras/QtQml.qmlRegisterUncreatableType.rst b/sources/pyside6/doc/extras/QtQml.qmlRegisterUncreatableType.rst deleted file mode 100644 index be25f5f1e..000000000 --- a/sources/pyside6/doc/extras/QtQml.qmlRegisterUncreatableType.rst +++ /dev/null @@ -1,38 +0,0 @@ -.. currentmodule:: PySide6.QtQml -.. _qmlRegisterUncreatableType: - - -qmlRegisterUncreatableType -************************** - - -.. py:function:: qmlRegisterUncreatableType(pytype: type, uri: str, versionMajor: int, versionMinor: int, qmlName: str, noCreationReason: str) -> int - - - :param type pytype: Python class - :param str uri: uri to use while importing the component in QML - :param int versionMajor: major version - :param int versionMinor: minor version - :param str qmlName: name exposed to QML - :param str noCreationReason: Error message shown when trying to create the QML type - :return: int (the QML type id) - - This function registers the Python *type* in the QML system as an uncreatable type with the - name *qmlName*, in the library imported from *uri* having the - version number composed from *versionMajor* and *versionMinor*, - showing *noCreationReason* as an error message when creating the type is attempted. - - For example, this registers a Python class 'MySliderItem' as a QML - type named 'Slider' for version '1.0' of a module called - 'com.mycompany.qmlcomponents': - - :: - qmlRegisterUncreatableType(MySliderItem, "com.mycompany.qmlcomponents", 1, 0, "Slider", "Slider cannot be created.") - - Note that it's perfectly reasonable for a library to register types - to older versions than the actual version of the library. - Indeed, it is normal for the new library to allow QML written to - previous versions to continue to work, even if more advanced - versions of some of its types are available. - - Alternatively, the :ref:`QmlUncreatable` decorator can be used. |
