[PyQt] QStyle manipulations

Hans-Peter Jansen hpj at urpla.net
Fri Jul 24 00:03:47 BST 2009


Hi,

I've some layout issues with customized widgets on the Mac, and now, I would 
like to _intercept_ a single QStyle method: layoutSpacingImplementation(), 
but how? I can create a style with QtGui.QStyleFactory.create(), but how do 
I intercept such a method? PyQt forbids me to subclass the style object, 
returned from factory (Phil, shouldn't these derive from QCommonStyle, and 
been able to subclass? [1])  and the "dirty as hell" - patch it into the 
object - approach seem to not work either. Any more ideas?

BTW, Phil, you don't wrap the style classes directly, because they may be 
plug-ins, but what's the technical reason behind this? Aren't there hosts 
of other plug-ins (sql drivers, image formats, etc..) in use today?

Pete

[1] http://www.riverbankcomputing.com/static/Docs/PyQt4/html/qstyle.html:
    "Creating a Custom Style" paragraph


More information about the PyQt mailing list