From 6d01aa2b090bd3aeead894df66085383a16b71bd Mon Sep 17 00:00:00 2001
From: Luke Campagnola <>
Date: Tue, 3 Jul 2012 14:44:07 -0400
Subject: [PATCH] Bugfixes: - workaround for PySide exit crash - fixed alpha of
major/minor grid lines
---
graphicsItems/AxisItem.py | 2 +-
graphicsItems/PlotItem/plotConfigTemplate.py | 2 +-
graphicsItems/PlotItem/plotConfigTemplate.ui | 2 +-
widgets/GraphicsView.py | 5 +++++
4 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/graphicsItems/AxisItem.py b/graphicsItems/AxisItem.py
index 27589636..351b4ed5 100644
--- a/graphicsItems/AxisItem.py
+++ b/graphicsItems/AxisItem.py
@@ -559,7 +559,7 @@ class AxisItem(GraphicsWidget):
lineAlpha = 255 / (i+1)
if self.grid is not False:
- lineAlpha = self.grid
+ lineAlpha *= self.grid/255. * np.clip((0.05 * lengthInPixels / (len(ticks)+1)), 0., 1.)
for v in ticks:
## determine actual position to draw this tick
diff --git a/graphicsItems/PlotItem/plotConfigTemplate.py b/graphicsItems/PlotItem/plotConfigTemplate.py
index 9a107e9d..0c620839 100644
--- a/graphicsItems/PlotItem/plotConfigTemplate.py
+++ b/graphicsItems/PlotItem/plotConfigTemplate.py
@@ -116,7 +116,7 @@ class Ui_Form(object):
self.gridLayout_2.addWidget(self.yGridCheck, 1, 0, 1, 2)
self.gridAlphaSlider = QtGui.QSlider(self.gridGroup)
self.gridAlphaSlider.setMaximum(255)
- self.gridAlphaSlider.setProperty("value", 70)
+ self.gridAlphaSlider.setProperty("value", 128)
self.gridAlphaSlider.setOrientation(QtCore.Qt.Horizontal)
self.gridAlphaSlider.setObjectName(_fromUtf8("gridAlphaSlider"))
self.gridLayout_2.addWidget(self.gridAlphaSlider, 2, 1, 1, 1)
diff --git a/graphicsItems/PlotItem/plotConfigTemplate.ui b/graphicsItems/PlotItem/plotConfigTemplate.ui
index a1807fd6..516ec721 100644
--- a/graphicsItems/PlotItem/plotConfigTemplate.ui
+++ b/graphicsItems/PlotItem/plotConfigTemplate.ui
@@ -221,7 +221,7 @@
255
- 70
+ 128
Qt::Horizontal
diff --git a/widgets/GraphicsView.py b/widgets/GraphicsView.py
index b3d2863f..6f7da132 100644
--- a/widgets/GraphicsView.py
+++ b/widgets/GraphicsView.py
@@ -104,6 +104,11 @@ class GraphicsView(QtGui.QGraphicsView):
self.sceneObj = GraphicsScene()
self.setScene(self.sceneObj)
+ ## Workaround for PySide crash
+ ## This ensures that the scene will outlive the view.
+ if pyqtgraph.Qt.USE_PYSIDE:
+ self.sceneObj._view_ref_workaround = self
+
## by default we set up a central widget with a grid layout.
## this can be replaced if needed.
self.centralWidget = None