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 905 - QtGui.QHBoxLayout.setMargin function call is created by pyside-uic, but this is not available in the pyside bindings
: QtGui.QHBoxLayout.setMargin function call is created by pyside-uic, but this ...
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: pyside-tools
: HEAD
: N900 Maemo5/Fremantle
: P2 normal
Assigned To: Lauro Moura
:
:
:
  Show dependency treegraph
 
Reported: 2011-06-29 14:55 EEST by theheadofabroom
Modified: 2011-07-22 22:12 EEST (History)
9 users (show)

See Also:


Attachments
ui file as requested. (9.63 KB, application/octet-stream)
2011-07-05 16:41 EEST, theheadofabroom
Details

Note You need to log in before you can comment on or make changes to this bug.
Description theheadofabroom 2011-06-29 14:55:23 EEST
I am developing a project on the N900 for mobile and desktop use, and had been
using PyQt4 until I found that the bindings were not fully up to date for
Qt4.7, so have switched to PySide. The transition has been mostly painless,
however my ui includes a nested layout with groups of buttons which are
shown/hidden depending on what is selected, where I wish it to look like it's
one long layout, so I've been tweaking the margins in Qt Designer to achieve
this affect. When I use PyQt4 this is fine, but other functionality is broken.
When I use PySide I get almost identical code, including the two lines below:

self.verticalLayout = QtGui.QVBoxLayout(self.widget)
self.verticalLayout.setMargin(0)

However PySide complains:

AttributeError: 'PySide.QtGui.QVBoxLayout' object has no attribute 'setMargin'

A bit of google-foo shows me that this was declared to be obsolete after Qt4.3
(line 2463 of
http://qt.gitorious.org/pyside/hugopl-pyside-shiboken/blobs/44af04703081f529c433f0fbc5229e9e0d12304f/PySide/QtGui/typesystem_gui_common.xml)

I was not aware that this was obsolete, but sure enough I can't find it in the
pyside docs, so I would assume that it's not in there. I have commented out the
offending setMargin calls in the .py files, but the gui now looks ugly. If
there is some other way to achieve this visual effect then surely this aught to
be what pyside-uic uses? Regardless of this I do not see that pyside-uic should
generate code that pyside does not support.
Comment 1 renato filho 2011-06-29 17:16:14 EEST
Yes this is a obsolete function and because of that this is not present on
PySide API. As a time workaround for that is replace the functions call to
setSpacing or setContentsMargins.

We will fix the pyside-uic during the next weeks,

Thanks for the report
Comment 2 renato filho 2011-07-05 16:12:02 EEST
Could you provide your .ui file?
I do not know how to set the margin properties, because this is not present on
designer properties list.
Comment 3 renato filho 2011-07-05 16:20:10 EEST
Which version of pyside-uic are you using?

You can check that with:

pyside-uic --version
Comment 4 theheadofabroom 2011-07-05 16:41:02 EEST
Created attachment 366 [details]
ui file as requested.
Comment 5 theheadofabroom 2011-07-05 16:41:21 EEST
[1|user@Nokia-N900|~]pyside-uic --version
Python User Interface Compiler version 0.2.2 for PySide
Comment 6 renato filho 2011-07-05 17:09:25 EEST
Ok this bug was fixed on the new version, but for some reason the fremantle
packages was not updated I will contact the guys who are responsible for these
packages.

Thanks
Comment 7 renato filho 2011-07-05 17:11:57 EEST
as a workaround until the packages get update you can use the pyside-uic from
the desktop version.
Comment 8 theheadofabroom 2011-07-05 19:04:10 EEST
Cheers for this - do you know of anywhere I could monitor for this change?
Comment 9 renato filho 2011-07-05 19:40:13 EEST
I will keep this bug open until the packages was updated.
Comment 10 renato filho 2011-07-05 21:43:25 EEST
package uploaded.

Thanks for report
Comment 11 renato filho 2011-07-22 22:12:49 EEST
release 1.0.5