[PyKDE] Re: [PyQt] Problem with generated pyuic code: QSizePolicy()
donald.welch at hp.com
Tue Mar 1 23:24:51 GMT 2005
OK, I went back and read all the posts on this issue that I neglected to
read before I posted this.
One question remains: What version of PyQt (or, is it part of Eric?) has
the version of pyuic that will generate code that works with SIP 4.2
(that is, it generates enums rather than integers for the QSizePolicy
I don't have the luxury of specifying what version of SIP is installed
on a system for my code to work. I certainly cannot count on a "hacked"
version that turns off the enum checking. Therefore, I assume that
passing the enums is the safest way to assure that it works "across the
> The following line of code (generated by pyuic under Eric 3.5.0) causes
> my program to fail (silently, no traceback or segfault, etc):
> What I don't understand is what is being passed into QSizePolicy. From
> the docs, the 2 allowable initializers are:
> QSizePolicy::QSizePolicy ( SizeType hor, SizeType ver, bool hfw=FALSE )
> QSizePolicy::QSizePolicy ( SizeType hor, SizeType ver, uchar horStretch,
> uchar verStretch, bool hfw = FALSE )
> Where SizeType is one of:
> From this, I understand that hor=5, ver=5, horStretch=0, verStretch=0.
> So one question is, why are these being passed in as integers rather
> than using the SizeType values?
> This IconView is setup with a "Preferred" size policy, so I change the
> code to:
> With this change, the code works again as expected.
> This is only occuring on a Mandrake Cooker system, with PyQt 3.14, Qt
> 3.3.4 and SIP 4.2.
> On a Gentoo box with PyQt 3.13, SIP 4.1.1, and Qt 3.3.3, this code works
More information about the PyQt