Corrected behavior of GraphicsView.setBackground
This commit is contained in:
parent
d3f56c6df3
commit
824e4b378b
@ -82,6 +82,7 @@ class GraphicsView(QtGui.QGraphicsView):
|
|||||||
## This might help, but it's probably dangerous in the general case..
|
## This might help, but it's probably dangerous in the general case..
|
||||||
#self.setOptimizationFlag(self.DontSavePainterState, True)
|
#self.setOptimizationFlag(self.DontSavePainterState, True)
|
||||||
|
|
||||||
|
self.setBackgroundRole(QtGui.QPalette.NoRole)
|
||||||
self.setBackground(background)
|
self.setBackground(background)
|
||||||
|
|
||||||
self.setFocusPolicy(QtCore.Qt.StrongFocus)
|
self.setFocusPolicy(QtCore.Qt.StrongFocus)
|
||||||
@ -138,9 +139,6 @@ class GraphicsView(QtGui.QGraphicsView):
|
|||||||
self._background = background
|
self._background = background
|
||||||
if background == 'default':
|
if background == 'default':
|
||||||
background = pyqtgraph.getConfigOption('background')
|
background = pyqtgraph.getConfigOption('background')
|
||||||
if background is None:
|
|
||||||
self.setBackgroundRole(QtGui.QPalette.NoRole)
|
|
||||||
else:
|
|
||||||
brush = fn.mkBrush(background)
|
brush = fn.mkBrush(background)
|
||||||
self.setBackgroundBrush(brush)
|
self.setBackgroundBrush(brush)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user