[PyQt] PyQt5 fails to handle QQuickImageProvider subclassing
Julio César Gázquez
julio_lists at mebamutual.com.ar
Wed Jan 4 19:01:58 GMT 2017
Hello list. Hi Phil.
I'm dipping my toes on QML. I subclassed QQuickImageProvider in order to
access images stored in a database from the QML side of my app.
Unfortunately, when the QML engine tries to call the provider I'm
getting the following error:
ImageProvider supports Image type but has not implemented requestImage()
Seems this message comes from Qt's QQuickImageProvider::requestImage()
implementation, so it's like the C++ method isn't being overridden by
the PyQt's wrapper method.
At least the alternate QQuickImageProvider::requestPixmap() has the same
problem.
These methods are somewhat peculiar, as they are virtual methods (and
specifically meant to be subclassed) and have an /Out/ parameter. Doing
a grep on the PyQt sources I see this only happens in two places outside
this class. Maybe the wrapper for the virtual method lacks the /Out/
parameter?
BTW, at least another guy was bitten for this:
http://stackoverflow.com/questions/40787663/pyqt5-qquickimageprovider-not-working.
I'm tested it on PyQt5 5.5.1, I'm not sure if it could be fixed in later
versions.
Thanks in advance.
Greetings, Julio.
More information about the PyQt
mailing list