[PyQt] a unhandled case uiparser.py:createSpacer
Phil Thompson
phil at riverbankcomputing.com
Thu May 5 12:06:34 BST 2011
On Thu, 05 May 2011 22:59:53 +1200, Achim Gädke <Achim.Gaedke at vuw.ac.nz>
wrote:
> Hi there!
>
> Today I used the qt designer, added some spacers to centre some knobs.
>
> I wanted to reduce/reset the sizeHint of the spacers, so I pressed the
> reset button right of the value field, which resets the sizeHint
> property to 0x0, that's perfectly what I want. So I saved the .ui file
> and started my application:
>
> [...]
> File "/usr/lib/pymodules/python2.6/PyQt4/uic/uiparser.py", line 308, in
> createSpacer
> width = int(elem.findtext("property/size/width"))
> TypeError: int() argument must be a string or a number, not 'NoneType'
>
> Setting the sizeHint to 1x1 works fine. - The designer sets by default a
> non-zero value.
>
> The code in createSpacer assumes the presence of width and hight
> parameters, which is fatal in this case.
>
> (I didn't dig into the definition of the .ui file, to see whether its
> format requires the presence, at least the qt documentation does not
> forbid 0x0 spacer dimensions.)
Which version of PyQt?
Can you send .ui file that demonstrates the problem?
Phil
More information about the PyQt
mailing list