1

Pyuic utility from new PyQt4 4.11.4 produces all layouts slightly displaced or compressed. That's how it initially looks in designer:

enter image description here

An thats how it looks after pyuic makes *.py file:

enter image description here

The reason is that new pyuic doesn't make setMargin(0) for all layouts (previously I used PyQt4.9.6 and it was set in *.py file, so it was ok). Is there any solution for this?

In the end certainly I can modify *.py files manually with script to add setMargin(0) for all layouts, but there should be more civilized way.. unless this is a bug.

Thanks.

three_pineapples
  • 11,579
  • 5
  • 38
  • 75
funnyp0ny
  • 298
  • 1
  • 12
  • Works fine for me. The `setMargin` function is obsolete, so `setContentsMargins` should be used instead (which is what `pyuic` currently does). You should probably post an example `ui` file if you want a proper diagnosis. – ekhumoro Jul 15 '15 at 17:56
  • 1
    @ekhumoro Thanks! Now I found a workaround - if I set all margins in designer to some value and return them back to 0 - it remembers that and goes ok. Concerning `ui` file - the difference is that after "workaround" it adds to the layout ` 0 `.. I've already reinstalled python and pyqt several times and it's still there. – funnyp0ny Jul 15 '15 at 21:09

1 Answers1

0

I met the same issue and found the workaround in the comment by @funnpony. I would add an answer based on the comment for someone who come to this question by google search to get a quick workaroud.

The workaround is:

Add <property name="margin"> <number>0</number> </property> attribute to the item that miss .setMargin method. Or
<property name="leftMargin"> <number>0</number> </property> <property name="rightMargin"> <number>0</number> </property> <property name="topMargin"> <number>0</number> </property> <property name="bottomMargin"> <number>0</number> </property>

ZJ Lyu
  • 331
  • 3
  • 10