PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 789 - pysideuic generate broken code from .ui file
: pysideuic generate broken code from .ui file
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: pyside-tools
: HEAD
: All All
: P2 normal
Assigned To: Hugo Parente Lima
:
:
:
  Show dependency treegraph
 
Reported: 2011-03-24 16:44 EET by Daniele Esposti
Modified: 2011-04-01 23:16 EEST (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniele Esposti 2011-03-24 16:44:30 EET
pysideuic generates code not consistent with the current Qt 4.7 API when a
QLayout with a custom margin property is involved.
That .ui snipped:

<layout class="QHBoxLayout">
  <property name="margin">
    <number>0</number>
  </property>
</layout>

generates this code:

self.horizontalLayout = QtGui.QHBoxLayout(self.widget)
self.horizontalLayout.setMargin(0)

but QLayout doesn't have a setMargin() method (maybe should be
setContentsMargins() instead?)
Comment 1 Hugo Parente Lima 2011-03-25 01:07:00 EET
setMargin/margin() were not binded because they are obsoletes IIRC.

Prioritizing as P2 as using layouts on ui files is a very common use case.

Thanks for report the issue!
Comment 2 Hugo Parente Lima 2011-03-25 15:28:35 EET
FYI

QtDesigner from Qt4.7 doesn't generate the <property name="margin"> tag, so you
can quickly fix this saving your .ui file using QtDesigner from Qt4.7 if
possible, I didn't tested with QtDesginer from Qt4.6

Anyway the bug still valid.

Could you attach your problematic .ui file in this bug report?
Comment 3 Hugo Parente Lima 2011-03-25 16:08:31 EET
Fixed in commit:

pyside-tools/cdbac9fb4214e209d2f1225b3a15bd0d01442e6f

Could you check if the fix worked for you?
Comment 4 Daniele Esposti 2011-03-25 17:08:31 EET
Hi Hugo,

yes, it's working fine. I tested with my .ui files created with Qt Designer 4.6
and 4.7.
Comment 5 Hugo Parente Lima 2011-04-01 23:16:00 EEST
Closing bug after release of PySide 1.0.1.