[PyQt] Broken examples in PyQt5
Vincent Vande Vyvre
vincent.vandevyvre at swing.be
Thu Jul 25 23:50:09 BST 2013
Le 25/07/2013 17:35, Dmitry Shachnev a écrit :
> Two examples, namely mainwindows/menus.py and mainwindows/separations.py,
> fail with AttributeError here (using PyQt 5.0 and Qt 5.0.2):
>
> Traceback (most recent call last):
> File "./mainwindows/menus.py", line 284, in <module>
> window = MainWindow()
> File "./mainwindows/menus.py", line 71, in __init__
> vbox.setMargin(5)
> AttributeError: 'QVBoxLayout' object has no attribute 'setMargin'
>
> Traceback (most recent call last):
> File "./mainwindows/separations.py", line 484, in <module>
> window = Viewer()
> File "./mainwindows/separations.py", line 272, in __init__
> self.setCentralWidget(self.createCentralWidget())
> File "./mainwindows/separations.py", line 330, in createCentralWidget
> grid.setMargin(4)
> AttributeError: 'QGridLayout' object has no attribute 'setMargin'
>
> Other examples I tested work fine. Is this a PyQt bug?
>
> --
> Dmitry Shachnev
>
>
> _______________________________________________
> PyQt mailing list PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
There's no setMargin() in Qt5, use setContentsMargins() instead.
--
Vincent V.V.
Oqapy <https://launchpad.net/oqapy> . Qarte
<https://launchpad.net/qarte> . PaQager <https://launchpad.net/paqager>
More information about the PyQt
mailing list