AttributeError: module 'PyQt6.QtQml' has no attribute 'QQmlExtensionPlugin'

Phil Thompson phil at riverbankcomputing.com
Fri May 14 15:07:14 BST 2021


On 12/05/2021 21:29, Kyle Altendorf wrote:
> Hi,
> 
> I'm working on adding Qt6 support to the pyqt-tools family of packages
> and am running into issues with QML plugins.  I get an error that
> seems, so far, to be coming not from my code.
> 
>   AttributeError: module 'PyQt6.QtQml' has no attribute 
> 'QQmlExtensionPlugin'
> 
> Searching the PyQt6 6.1.0 source for QQmlExtensionPlugin I get the
> following hits.
> 
> 
> PyQt6-6.1.0/examples/quick/tutorials/extending/chapter6-plugins/Charts/chartsplugin.py:from
> PyQt6.QtQml import qmlRegisterType, QQmlExtensionPlugin
> 
> PyQt6-6.1.0/examples/quick/tutorials/extending/chapter6-plugins/Charts/chartsplugin.py:class
> ChartsPlugin(QQmlExtensionPlugin):
> 
> PyQt6-6.1.0/qmlscene/pluginloader.cpp:PyQt6QmlPlugin::PyQt6QmlPlugin(QObject
> *parent) : QQmlExtensionPlugin(parent),
>   PyQt6-6.1.0/qmlscene/pluginloader.cpp:    // Get
> QQmlExtensionPlugin.  We do this after the import of the plugin to
>   PyQt6-6.1.0/qmlscene/pluginloader.cpp:            
> "QQmlExtensionPlugin");
>   PyQt6-6.1.0/qmlscene/pluginloader.cpp:    // QQmlExtensionPlugin.
>   PyQt6-6.1.0/qmlscene/pluginloader.cpp:                "%s does not
> contain an implementation of QQmlExtensionPlugin",
>   PyQt6-6.1.0/qmlscene/pluginloader.h:#include <QQmlExtensionPlugin>
>   PyQt6-6.1.0/qmlscene/pluginloader.h:class PyQt6QmlPlugin : public
> QQmlExtensionPlugin
>   PyQt6-6.1.0/ChangeLog:  Removed the internal QQmlExtensionPlugin 
> class.
> 
> I notice the last hit is the changelog entry saying that
> QQmlExtensionPlugin has been removed.  Yet, it is still referenced
> twice in `pluginloader.cpp`.
> 
> Is this a sufficient report or do I need to make up a minimal
> reproduction?  The apparent conflict between the source and the
> changelog seemed like it may be sufficient.  Maybe at least to lead to
> an explanation or resource I should read.

QQmlExtensionPlugin will be restored in the next snapshot.

Thanks,
Phil


More information about the PyQt mailing list