[PyQt] PyQt4 481 (Prebuild for Python 2.6) issue with QToolBar

Phil Thompson phil at riverbankcomputing.com
Sat Oct 23 13:28:02 BST 2010


On Sat, 23 Oct 2010 12:41:35 +0200, Tobias Rzepka
<tobias.rzepka at googlemail.com> wrote:
> Hello,
> 
> I have a problem with the newly released PyQt4 version 4.8.1 on Python
2.6.
> I load an ui file at runtime with uic.loadUi. In case there is a 
> QToolBar I get the following error:
> 
> Traceback (most recent call last):
> 
>    File "D:\Projekte\Python\PyQt4_81_Bug\PyQt4_81_Bug.py", line 34,
>    in<module>
> 
>      widget = GUI_Implementation()
> 
>    File "D:\Projekte\Python\PyQt4_81_Bug\PyQt4_81_Bug.py", line 25, in
>    __init__
> 
>      uic.loadUi(r"PyQt4_81_Bug.ui", self)
> 
>    File "C:\Python26\lib\site-packages\PyQt4\uic\__init__.py", line 185,
>    in loadUi
> 
>      return DynamicUILoader().loadUi(uifile, baseinstance)
> 
>    File "C:\Python26\lib\site-packages\PyQt4\uic\Loader\loader.py", line
>    31, in loadUi
> 
>      return self.parse(filename, os.path.dirname(filename))
> 
>    File "C:\Python26\lib\site-packages\PyQt4\uic\uiparser.py", line 830,
>    in parse
> 
>      actor(elem)
> 
>    File "C:\Python26\lib\site-packages\PyQt4\uic\uiparser.py", line 677,
>    in createUserInterface
> 
>      self.traverseWidgetTree(elem)
> 
>    File "C:\Python26\lib\site-packages\PyQt4\uic\uiparser.py", line 655,
>    in traverseWidgetTree
> 
>      handler(self, child)
> 
>    File "C:\Python26\lib\site-packages\PyQt4\uic\uiparser.py", line 251,
>    in createWidget
> 
>      tbArea = self.wprops.getAttribute(elem, "toolBarArea")
> 
>    File "C:\Python26\lib\site-packages\PyQt4\uic\properties.py", line
342,
>    in getAttribute
> 
>      return self._getChild("attribute", elem, name, default)
> 
>    File "C:\Python26\lib\site-packages\PyQt4\uic\properties.py", line
334,
>    in _getChild
> 
>      return self.convert(prop)
> 
>    File "C:\Python26\lib\site-packages\PyQt4\uic\properties.py", line
328,
>    in convert
> 
>      return func(prop[0], **args)
> 
>    File "C:\Python26\lib\site-packages\PyQt4\uic\properties.py", line
82,
>    in _enum
> 
>      return self._pyEnumMember(prop.text)
> 
>    File "C:\Python26\lib\site-packages\PyQt4\uic\properties.py", line
61,
>    in _pyEnumMember
> 
>      prefix, membername = cpp_name.split("::")
> 
> ValueError: need more than 1 value to unpack
> 
> 
> I think it's a PyQt4 4.8.1 bug because with 4.7.x there were no such 
> behavior.
> To reproduce it I created a new application from scratch with the same 
> effect (see attachment).

The attached patch should fix it.

Thanks,
Phil
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PyQt-4.8-pyuic.diff
Type: text/x-diff
Size: 576 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20101023/3d852747/attachment.diff>


More information about the PyQt mailing list