qmlRegisterSingletonInstance¶
- qmlRegisterSingletonInstance(pytype: type, uri: str, versionMajor: int, versionMinor: int, typeName: str, instanceObject: object) int ¶
- Parameters
pytype (type) – Python class
uri (str) – uri to use while importing the component in QML
versionMajor (int) – major version
versionMinor (int) – minor version
typeName (str) – name exposed to QML
instanceObject (object) – singleton object to be registered
- Returns
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.
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.