Remove padding around item in GraphicsLayoutWidget

1,287 views
Skip to first unread message

CPrescher

unread,
Jun 6, 2014, 4:37:01 PM6/6/14
to pyqt...@googlegroups.com
Hei,

i have a small question:

I would like to remove the black border (I presume it is a padding parameter) around GraphicsLayoutWidget. Right now when e.g. loading an image, there is always some black border around the edges of the image.

Best wishes
Clemens

Luke Campagnola

unread,
Jun 6, 2014, 5:29:20 PM6/6/14
to pyqt...@googlegroups.com
Internallly this uses a QGraphicsGridLayout, so you can access the layout directly to change the margins and spacing:

    w = pg.GraphicsLayoutWidget()
    w.ci.layout.setContentsMargins(0, 0, 0, 0)
    w.ci.layout.setSpacing(0)  # might not be necessary for you


CPrescher

unread,
Jun 7, 2014, 8:07:22 AM6/7/14
to pyqt...@googlegroups.com
It works. Thank you!
Reply all
Reply to author
Forward
0 new messages