[PyQt] Re: Problem with latest PyQt4 snapshot

Phil Thompson phil at riverbankcomputing.com
Wed Sep 23 09:12:21 BST 2009


On Tue, 22 Sep 2009 20:18:27 +0200, Detlev Offenbach
<detlev at die-offenbachs.de> wrote:
> On Dienstag, 22. September 2009, Phil Thompson wrote:
>> On Tue, 22 Sep 2009 18:42:47 +0200, Detlev Offenbach
>>
>> <detlev at die-offenbachs.de> wrote:
>> > On Dienstag, 22. September 2009, Phil Thompson wrote:
>> >> On Sat, 19 Sep 2009 19:47:00 +0200, Detlev Offenbach
>> >>
>> >> <detlev at die-offenbachs.de> wrote:
>> >> > Hi Phil,
>> >> >
>> >> > pyuic4 of the latest snapshot is a bit buggy. It does wrap the
value
>> >> > set
>> >> > via
>> >> > QObject.setProperty(...) into a QVariant. That makes code generated
>> >> > with
>> >> > this
>> >> > pyuic incompatible with older PyQt4 versions.
>> >>
>> >> pyuic doesn't guarantee that it will generate code that will work
with
>>
>> an
>>
>> >> earlier version of PyQt that it is a part of. Otherwise it would be
>> >> difficult to introduce new features.
>> >>
>> >> If you don't have control over the version of PyQt your users are
>> >> using
>> >> then you should run pyuic as part of your installation process (or
>> >> dynamically load the .ui files).
>> >>
>> >> Phil
>> >> _______________________________________________
>> >> PyQt mailing list    PyQt at riverbankcomputing.com
>> >> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>> >
>> > That is too bad and pyuic didn't do that in the past.
>>
>> Yes it did, it just doesn't happen very often and only when necessary.
>> uic
>> is the same.
>>
>> > It probably means,
>> > that
>> > I won't do eric4 development using PyQt 4.6 until the day I'll switch
>> > to
>> > Python 3.
>>
>> Phil
>> _______________________________________________
>> PyQt mailing list    PyQt at riverbankcomputing.com
>> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
> 
> Currently the only issue I came across was the one I described in my
> original 
> mail. Would it be possible to add a commandline switch to add backward 
> compatibility?

Possible, but I don't want to. As I said an application that ships pyuic
generated code expecting it to work on previous versions of PyQt is buggy.
Almost all of the time you will get away with it, but I won't promise that
that will be the case (or imply it by starting to add compatibility flags).

It's not as if the correct thing to do is very difficult - particularly if
you have a Python installation script. Just import PyQt4.uic.compileUi()
and call it. I wouldn't object to adding something like compileUiDir() that
will call compileUi() on all the .ui files in a given directory.

Phil


More information about the PyQt mailing list