Workaround for Qt bug: wrap setSpacing and setContentsMargins from

internal layout of GraphicsLayout.

http://stackoverflow.com/questions/27092164/margins-in-pyqtgraphs-graphicslayout/27105642#27105642
This commit is contained in:
Luke Campagnola 2014-11-24 13:09:59 -05:00
parent 7fa0ce9711
commit 2bf4a0eb7b

View File

@ -160,4 +160,12 @@ class GraphicsLayout(GraphicsWidget):
for i in list(self.items.keys()):
self.removeItem(i)
def setContentsMargins(self, *args):
# Wrap calls to layout. This should happen automatically, but there
# seems to be a Qt bug:
# http://stackoverflow.com/questions/27092164/margins-in-pyqtgraphs-graphicslayout
self.layout.setContentsMargins(*args)
def setSpacing(self, *args):
self.layout.setSpacing(*args)