<div dir="ltr">Is my question vague, or is this not implemented as documented?</div><div class="gmail_extra"><br><div class="gmail_quote">On 9 November 2014 11:24, Marcus Ottosson <span dir="ltr"><<a href="mailto:konstruktion@gmail.com" target="_blank">konstruktion@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><span class=""><blockquote style="margin:1.2em 0px;border-left-width:4px;border-left-style:solid;border-left-color:rgb(221,221,221);padding:0px 1em;color:rgb(119,119,119);quotes:none">
<p style="margin:1.2em 0px!important">It looks for a class that is derived from QQmlExtensionPlugin.</p>
</blockquote>
</span><p style="margin:1.2em 0px!important">Fair enough, but how come it doesn’t work?</p>
<div title="MDH:Jmd0O8KgPHNwYW4gc3R5bGU9ImZvbnQtZmFtaWx5OiBhcmlhbCwgc2Fucy1zZXJpZjsgZm9udC1z
aXplOiAxM3B4OyI+SXQgbG9va3MgZm9yIGEgY2xhc3MgdGhhdCBpcyBkZXJpdmVkIGZyb20gUVFt
bEV4dGVuc2lvblBsdWdpbi48L3NwYW4+PGRpdj48c3BhbiBzdHlsZT0iZm9udC1mYW1pbHk6IGFy
aWFsLCBzYW5zLXNlcmlmOyBmb250LXNpemU6IDEzcHg7Ij48YnI+PC9zcGFuPjwvZGl2PjxkaXY+
PGZvbnQgZmFjZT0iYXJpYWwsIHNhbnMtc2VyaWYiPkZhaXIgZW5vdWdoLCBidXQgaG93IGNvbWUg
aXQgZG9lc24ndCB3b3JrPzwvZm9udD48L2Rpdj4=" style="min-height:0;font-size:0em;padding:0;margin:0">​</div></div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On 9 November 2014 11:16, Phil Thompson <span dir="ltr"><<a href="mailto:phil@riverbankcomputing.com" target="_blank">phil@riverbankcomputing.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On 09/11/2014 10:54 am, Marcus Ottosson wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>
Hi,<br>
<br>
I’m attempting to write a Python plug-in for QML but are having issues in<br>
getting it to work.<br>
<br></span>
   -<br>
<br>
   PyQt5 5.3.2/5.3.1<br>
    -<br>
<br>
   Qt 5.3.2/5.3.1<br>
    -<br>
<br>
   Python 2.7<span><br>
    -<br>
<br>
   Ubuntu 12.04 and Windows 8<br>
<br>
Running the Charts example produces the error:<br>
<br>
..extending/chapter6-plugins/<u></u>app.qml:42 module "Charts" is not installed<br>
<br>
And writing my own does the same. In fact, I’m having trouble understanding<br>
how the qmldir is able to provide enough information about which class to<br>
use as subclass of QQmlExtensionPlugin.<br>
<br>
Here’s the Charts qmldir file.<br>
<br>
module Charts<br>
plugin pyqt5qmlplugin<br>
<br>
I also tried modifying it to point to the directory with the pyqt5qmlplugin<br>
library.<br>
<br>
module Charts<br>
plugin `pyqt5qmlplugin` /home/marcus/Qt/5.3/gcc_64/<u></u>plugins/PyQt5<br>
<br>
If I understand correctly, the pyqt5qmlplugin library is looking for a<br>
Python module with the same name as the module, in this case Charts,<br>
suffixed with “plugin.py”, so “Chartsplugin.py” (is the upper-case relevant<br>
here?) but when inside, how does it find the right class to use? Does it<br>
need to start with the same name as the module (i.e. “Charts”) and end with<br>
“Plugin”?<br>
<br>
Is there any other examples of this in action? So far, this is the only<br>
mention of pyqt5qmlplugin I’ve been able to find.<br>
<br></span>
   -<br>
<br>
<a href="http://pyqt.sourceforge.net/" target="_blank">http://pyqt.sourceforge.net/</a><u></u>Docs/PyQt5/qml.html#writing-<u></u>python-plugins-for-qmlscene<br>
</blockquote>
<br>
It looks for a class that is derived from QQmlExtensionPlugin.<br>
<br>
Phil<br>
______________________________<u></u>_________________<br>
PyQt mailing list    <a href="mailto:PyQt@riverbankcomputing.com" target="_blank">PyQt@riverbankcomputing.com</a><br>
<a href="http://www.riverbankcomputing" target="_blank">http://www.riverbankcomputing</a>.<u></u>com/mailman/listinfo/pyqt</blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br><div><div dir="ltr"><font size="1"><b>Marcus Ottosson</b><br><a href="mailto:konstruktion@gmail.com" target="_blank">konstruktion@gmail.com</a></font><font size="1"><br></font></div></div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><font size="1"><b>Marcus Ottosson</b><br><a href="mailto:konstruktion@gmail.com" target="_blank">konstruktion@gmail.com</a></font><font size="1"><br></font></div></div>
</div>