- class QQmlExtensionPlugin#
The
QQmlExtensionPlugin
class provides an abstract base for custom QML extension plugins with custom type registration functions. More…Synopsis#
Methods#
def
__init__()
def
baseUrl()
Virtual methods#
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description#
Note
If you need to write a plugin manually (which is rare) you should always use
QQmlEngineExtensionPlugin
.QQmlExtensionPlugin
only provides theregisterTypes()
andunregisterTypes()
functions in addition. You should not use them, but rather declare your types withQML_ELEMENT
and friends and have the build system take care of the registration.This is unnecessary and doesn’t work for optional plugins
Returns the URL of the directory from which the extension is loaded.
This is useful when the plugin also needs to load QML files or other assets from the same directory.
Note
You should not need this function. Other files that are part of the module’s public interface should be specified accordingly in the build system and qmldir file. The build system makes sure that they end up both in the final module directory, and in the resource file system. You can use the copy from the resource file system in the plugin. Non-QML/JS files private to the plugin can be added to the resource file system manually. However, consider moving all such functionality out of the plugin and making the plugin optional.
- unregisterTypes()#
Override this method to unregister types manually registered in
registerTypes
.