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 1025 - mainwindows/menus.py fails
: mainwindows/menus.py fails
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: Examples
: 1.0.7
: All All
: P3 normal
Assigned To: Hugo Parente Lima
:
:
:
  Show dependency treegraph
 
Reported: 2011-10-16 13:44 EEST by anatoly techtonik
Modified: 2011-10-20 22:53 EEST (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description anatoly techtonik 2011-10-16 13:44:34 EEST
$ python menus.py 
Traceback (most recent call last):
  File "menus.py", line 274, in <module>
    window = MainWindow()
  File "menus.py", line 50, in __init__
    vbox.setMargin(5)
AttributeError: 'PySide.QtGui.QVBoxLayout' object has no attribute 'setMargin'
Comment 1 Hugo Parente Lima 2011-10-17 17:53:14 EEST
Hi

setMargin is deprecated since Qt4.3 IIRC, use setContentsMargins instead.

Regards.
Comment 2 Hugo Parente Lima 2011-10-17 17:54:02 EEST
but.... this code was found in PySide examples?
Comment 4 anatoly techtonik 2011-10-17 18:47:00 EEST
Although it works if I replace setMargin(5) with setContentsMargins(5,5,5,5),
it would be nice if some PySide/Qt experts review the code in accordance with
best practices. ;)

But, of course it will be better if this GPL code could be released into public
domain or non-GPL license to be copy/paste compatible for a broader range of
projects.
Comment 5 Hugo Parente Lima 2011-10-17 20:00:52 EEST
Some examples are licensed under BSD, some not, because the original code was
GPLed.
Comment 6 anatoly techtonik 2011-10-18 00:20:09 EEST
It can be a task for the next Summer of Code or Code-In.
Comment 7 Hugo Parente Lima 2011-10-19 17:35:28 EEST
Fixed in commit:
pyside-examples/e0a768809e67a8732afaa0147ef64af10dfb69a6
Comment 8 Hugo Parente Lima 2011-10-20 22:53:49 EEST
Released on 1.0.8.