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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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