diff options
author | Cristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io> | 2020-07-24 09:24:15 +0200 |
---|---|---|
committer | Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> | 2020-07-24 10:29:16 +0000 |
commit | d8427f681deadc64eae3506d0bc2aad5cdb6b79f (patch) | |
tree | 0f8978e1a3d24f0b861532c11712173cd05e204a /sources/pyside2/PySide2/QtQml/typesystem_qml.xml | |
parent | cc91eb893e53ea2516d895bd1861c1159d5a5c90 (diff) |
doc: add qmlRegisterType and qmlRegisterSingletonType
when the inject-documentation tag is used inside a namespace
or module instead of class, it does not properly work.
With this workaround, the data will be rendered on the
online/offline documentation.
Task-number: PYSIDE-691
Change-Id: I832f43cb1ffba9294a2e282ba002ce4aff07e253
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside2/PySide2/QtQml/typesystem_qml.xml')
-rw-r--r-- | sources/pyside2/PySide2/QtQml/typesystem_qml.xml | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/sources/pyside2/PySide2/QtQml/typesystem_qml.xml b/sources/pyside2/PySide2/QtQml/typesystem_qml.xml index 79578e2c4..563d43652 100644 --- a/sources/pyside2/PySide2/QtQml/typesystem_qml.xml +++ b/sources/pyside2/PySide2/QtQml/typesystem_qml.xml @@ -66,48 +66,18 @@ </namespace-type> <add-function signature="qmlRegisterType(PyTypeObject,const char*,int,int,const char*)" return-type="int"> - <inject-documentation format="target" mode="append"> - 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. - Returns the QML type id. - - 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. - </inject-documentation> - <inject-code class="target" file="../glue/qtqml.cpp" snippet="qmlregistertype"/> </add-function> <add-function signature="qmlRegisterSingletonType(PyTypeObject,const char*,int,int,const char*,PyObject*)" return-type="int"> - <inject-documentation format="target" mode="append"> - 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. - </inject-documentation> <inject-code class="target" file="../glue/qtqml.cpp" snippet="qmlregistersingletontype_qobject_callback"/> </add-function> <add-function signature="qmlRegisterSingletonType(PyTypeObject,const char*,int,int,const char*)" return-type="int"> - <inject-documentation format="target" mode="append"> - This function registers a Python type as a singleton in the QML system. - </inject-documentation> <inject-code class="target" file="../glue/qtqml.cpp" snippet="qmlregistersingletontype_qobject_nocallback"/> </add-function> <add-function signature="qmlRegisterSingletonType(const char*,int,int,const char*,PyObject*)" return-type="int"> - <inject-documentation format="target" mode="append"> - 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. - </inject-documentation> <inject-code class="target" file="../glue/qtqml.cpp" snippet="qmlregistersingletontype_qjsvalue"/> </add-function> |