[PyQt] Designer plugins with non-default QString/etc. SIP API versions
fabian.knittel at lettink.de
Wed Jan 4 00:52:08 GMT 2012
we're currently migrating our Python 2.x PyQt4 code from
QString/QVariant/... SIP API version 1 to version 2 in preparation for
Python 3. The app works fine and we're quite happy with API version 2.
Unfortunately, our app specific Qt Designer plugins have stopped
working. The plugins use code from the app and therefore now depend on
API version 2, but the PyQt designer plugin loader loads
PyQt4.QtDesigner.QPyDesignerCustomWidgetPlugin before loading any of
our plugins and therefore the API version gets set to the default
The attached patch lazy loads
PyQt4.QtDesigner.QPyDesignerCustomWidgetPlugin after the first
successful plugin module import. Assuming full control over all
plugins and further assuming that all plugins use the same API
versions, this allows the plugins to call sip.setapi before any
default APIs are set.
Would something like this be acceptable upstream?
PS: The patch is against 4.7.3, but (as far as I can tell) 4.9 doesn't
appear to have changed much in designer/pluginloader.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1483 bytes
Desc: not available
More information about the PyQt