[PyQt] pyqt5qmlplugin

Marcus Ottosson konstruktion at gmail.com
Tue Nov 11 17:58:50 GMT 2014


Is my question vague, or is this not implemented as documented?

On 9 November 2014 11:24, Marcus Ottosson <konstruktion at gmail.com> wrote:

> It looks for a class that is derived from QQmlExtensionPlugin.
>
> Fair enough, but how come it doesn’t work?
>>
> On 9 November 2014 11:16, Phil Thompson <phil at riverbankcomputing.com>
> wrote:
>
>> On 09/11/2014 10:54 am, Marcus Ottosson wrote:
>>
>>> Hi,
>>>
>>> I’m attempting to write a Python plug-in for QML but are having issues in
>>> getting it to work.
>>>
>>>    -
>>>
>>>    PyQt5 5.3.2/5.3.1
>>>     -
>>>
>>>    Qt 5.3.2/5.3.1
>>>     -
>>>
>>>    Python 2.7
>>>     -
>>>
>>>    Ubuntu 12.04 and Windows 8
>>>
>>> Running the Charts example produces the error:
>>>
>>> ..extending/chapter6-plugins/app.qml:42 module "Charts" is not installed
>>>
>>> And writing my own does the same. In fact, I’m having trouble
>>> understanding
>>> how the qmldir is able to provide enough information about which class to
>>> use as subclass of QQmlExtensionPlugin.
>>>
>>> Here’s the Charts qmldir file.
>>>
>>> module Charts
>>> plugin pyqt5qmlplugin
>>>
>>> I also tried modifying it to point to the directory with the
>>> pyqt5qmlplugin
>>> library.
>>>
>>> module Charts
>>> plugin `pyqt5qmlplugin` /home/marcus/Qt/5.3/gcc_64/plugins/PyQt5
>>>
>>> If I understand correctly, the pyqt5qmlplugin library is looking for a
>>> Python module with the same name as the module, in this case Charts,
>>> suffixed with “plugin.py”, so “Chartsplugin.py” (is the upper-case
>>> relevant
>>> here?) but when inside, how does it find the right class to use? Does it
>>> need to start with the same name as the module (i.e. “Charts”) and end
>>> with
>>> “Plugin”?
>>>
>>> Is there any other examples of this in action? So far, this is the only
>>> mention of pyqt5qmlplugin I’ve been able to find.
>>>
>>>    -
>>>
>>> http://pyqt.sourceforge.net/Docs/PyQt5/qml.html#writing-
>>> python-plugins-for-qmlscene
>>>
>>
>> It looks for a class that is derived from QQmlExtensionPlugin.
>>
>> Phil
>> _______________________________________________
>> PyQt mailing list    PyQt at riverbankcomputing.com
>> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
>
>
>
> --
> *Marcus Ottosson*
> konstruktion at gmail.com
>



-- 
*Marcus Ottosson*
konstruktion at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20141111/1aff9b8f/attachment.html>


More information about the PyQt mailing list