change QPalette.Background to QPalette.Window
the former is obsolete in 5.15 and is removed in 6.0
This commit is contained in:
parent
c4addbeaea
commit
da0a94643c
@ -133,7 +133,7 @@ class GraphicsView(QtGui.QGraphicsView):
|
||||
# Set a transparent background QPalette!
|
||||
if QT_LIB in ["PySide2", "PyQt5"]:
|
||||
palette = self.palette()
|
||||
palette.setColor(QtGui.QPalette.Background, QtCore.Qt.transparent)
|
||||
palette.setColor(QtGui.QPalette.Window, QtCore.Qt.transparent)
|
||||
self.setPalette(palette)
|
||||
|
||||
def setAntialiasing(self, aa):
|
||||
|
@ -7,13 +7,13 @@ def test_basics_graphics_view():
|
||||
app = pg.mkQApp()
|
||||
view = pg.GraphicsView()
|
||||
background_role = view.backgroundRole()
|
||||
assert background_role == QtGui.QPalette.Background
|
||||
assert background_role == QtGui.QPalette.Window
|
||||
|
||||
palette = view.palette()
|
||||
|
||||
if pg.Qt.QT_LIB in ["PySide2", "PyQt5"]:
|
||||
assert palette.isBrushSet(QtGui.QPalette.Active, QtGui.QPalette.Background)
|
||||
assert palette.color(QtGui.QPalette.Background) == QtCore.Qt.transparent
|
||||
assert palette.isBrushSet(QtGui.QPalette.Active, QtGui.QPalette.Window)
|
||||
assert palette.color(QtGui.QPalette.Window) == QtCore.Qt.transparent
|
||||
assert view.backgroundBrush().color() == QtGui.QColor(0, 0, 0, 255)
|
||||
|
||||
assert view.focusPolicy() == QtCore.Qt.StrongFocus
|
||||
@ -41,8 +41,8 @@ def test_basics_graphics_view():
|
||||
palette = view.palette()
|
||||
if pg.Qt.QT_LIB in ["PySide2", "PyQt5"]:
|
||||
|
||||
assert palette.isBrushSet(QtGui.QPalette.Active, QtGui.QPalette.Background)
|
||||
assert palette.color(QtGui.QPalette.Background) == QtCore.Qt.transparent
|
||||
assert palette.isBrushSet(QtGui.QPalette.Active, QtGui.QPalette.Window)
|
||||
assert palette.color(QtGui.QPalette.Window) == QtCore.Qt.transparent
|
||||
assert view.backgroundBrush().color() == QtCore.Qt.white
|
||||
|
||||
# Set anti aliasing
|
||||
|
Loading…
Reference in New Issue
Block a user