From 2bf4a0eb7b8ddba8eef0e84668a602a72404c050 Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Mon, 24 Nov 2014 13:09:59 -0500 Subject: [PATCH] Workaround for Qt bug: wrap setSpacing and setContentsMargins from internal layout of GraphicsLayout. http://stackoverflow.com/questions/27092164/margins-in-pyqtgraphs-graphicslayout/27105642#27105642 --- pyqtgraph/graphicsItems/GraphicsLayout.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pyqtgraph/graphicsItems/GraphicsLayout.py b/pyqtgraph/graphicsItems/GraphicsLayout.py index b8325736..6ec38fb5 100644 --- a/pyqtgraph/graphicsItems/GraphicsLayout.py +++ b/pyqtgraph/graphicsItems/GraphicsLayout.py @@ -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) + \ No newline at end of file