[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] Bogus setMargin generated by pyuic4
From:       Saúl Ibarra Corretgé <saghul () gmail ! com>
Date:       2012-11-23 16:42:30
Message-ID: 50AFA776.4060006 () gmail ! com
[Download RAW message or body]

Phil Thompson wrote:
> On Tue, 20 Nov 2012 17:56:29 +0100, Saúl Ibarra Corretgé
> <saghul@gmail.com>
> wrote:
>> Hi all,
>>
>> I ran into a problem in which pyuic4 will generate a bogus setMargin
>> call and Google is not helping much, I hope someone can shed some light.
>>
>> Here is the test ui file:
>>
>> https://gist.github.com/4119155#file_test.ui
>>
>> It's a simple main window with a QHBoxLayout inside a QWidget. Margins
>> are all set to the same value: 5. Now, the generated code contains 2
>> calls to setMargin, one for 5 (correct) and another one with 0
>> (incorrect) for the layout:
>>
>> https://gist.github.com/4119155#file_test.py
>>
>> See lines 28-29.
>>
>> By inspecting uiparser.py, in function createLayout, an extra 'margin'
>> element is added (~line 433) because the layout is child of a QWidget
>> which is not the child of the main window. The code in that function
>> checks if there are individual margin elements but looks like fails in
>> the case where there is a single 'margin' element, that is, when all
>> margins are equal. If at least one margin is different then problem
>> doesn't appear.
>>
>> Is this a bug in the ui parser or am I doing something wrong here?
>
> Should be fixed in tonight's snapshot.
>
> Thanks,
> Phil

Works, thanks!

-- 
Saúl Ibarra Corretgé
http://saghul.net/blog | http://about.me/saghul
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic