Commit 824e4b37 authored by Luke Campagnola's avatar Luke Campagnola
Browse files

Corrected behavior of GraphicsView.setBackground

parent d3f56c6d
......@@ -82,6 +82,7 @@ class GraphicsView(QtGui.QGraphicsView):
## This might help, but it's probably dangerous in the general case..
#self.setOptimizationFlag(self.DontSavePainterState, True)
self.setBackgroundRole(QtGui.QPalette.NoRole)
self.setBackground(background)
self.setFocusPolicy(QtCore.Qt.StrongFocus)
......@@ -138,12 +139,9 @@ class GraphicsView(QtGui.QGraphicsView):
self._background = background
if background == 'default':
background = pyqtgraph.getConfigOption('background')
if background is None:
self.setBackgroundRole(QtGui.QPalette.NoRole)
else:
brush = fn.mkBrush(background)
self.setBackgroundBrush(brush)
brush = fn.mkBrush(background)
self.setBackgroundBrush(brush)
def paintEvent(self, ev):
self.scene().prepareForPaint()
#print "GV: paint", ev.rect()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment