drop lack of palette compatibility with Qt4

This commit is contained in:
KIU Shueng Chuan 2021-01-14 12:34:48 +08:00
parent 966ae7a3df
commit 283e9eb563
2 changed files with 7 additions and 11 deletions

View File

@ -131,7 +131,6 @@ class GraphicsView(QtGui.QGraphicsView):
self.clickAccepted = False
# Set a transparent background QPalette!
if QT_LIB in ["PySide2", "PyQt5"]:
palette = self.palette()
palette.setColor(QtGui.QPalette.Window, QtCore.Qt.transparent)
self.setPalette(palette)

View File

@ -11,7 +11,6 @@ def test_basics_graphics_view():
palette = view.palette()
if pg.Qt.QT_LIB in ["PySide2", "PyQt5"]:
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)
@ -39,8 +38,6 @@ def test_basics_graphics_view():
view.setBackground("w")
assert view._background == "w"
palette = view.palette()
if pg.Qt.QT_LIB in ["PySide2", "PyQt5"]:
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