Access to QLibrary pointers

Maurizio Berti maurizio.berti at gmail.com
Wed Aug 30 20:50:53 BST 2023


Some time ago I posted on StackOverflow (
https://stackoverflow.com/a/60895316/2001654 ) a "hacky" way to use the
qt_blurImage function that is internally used by Qt for graphics effects
and other things.

It basically uses ctypes to access the function in the QtWidgets library,
the implementation is a bit sketchy, but it works.

While checking it again, as a user had problems accessing the function in
Qt6, I stumbled upon the QLibrary class, and I was wondering if I could use
it instead.

Unfortunately, while the library loads and resolve() properly gets access
to the function, it returns a voidptr which obviously is not callable.

I have limited experience with SIP (I only used it on very few occasions
and with simple castings), so maybe the solution is quite simple, but I
really don't know how to make that pointer to a callable function - or even
if it's possible.

Also, I assume that the arguments would still be ctypes, right? If that's
the case, there would be no real benefit in using QLibrary, I suppose.

Still, it would be interesting to know if it could be used and how.

Thanks,
Maurizio

-- 
È difficile avere una convinzione precisa quando si parla delle ragioni del
cuore. - "Sostiene Pereira", Antonio Tabucchi
http://www.jidesk.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20230830/165a9695/attachment.htm>


More information about the PyQt mailing list