Do not apply transparent background in Qt4 (#1403)
* Do not apply transparent background in Qt4 * Tests need to reflect this change too
This commit is contained in:
parent
9f86eef2b9
commit
2c02d58134
@ -131,6 +131,7 @@ class GraphicsView(QtGui.QGraphicsView):
|
|||||||
self.clickAccepted = False
|
self.clickAccepted = False
|
||||||
|
|
||||||
# Set a transparent background QPalette!
|
# Set a transparent background QPalette!
|
||||||
|
if QT_LIB in ["PySide2", "PyQt5"]:
|
||||||
palette = self.palette()
|
palette = self.palette()
|
||||||
palette.setColor(QtGui.QPalette.Background, QtCore.Qt.transparent)
|
palette.setColor(QtGui.QPalette.Background, QtCore.Qt.transparent)
|
||||||
self.setPalette(palette)
|
self.setPalette(palette)
|
||||||
|
@ -10,6 +10,8 @@ def test_basics_graphics_view():
|
|||||||
assert background_role == QtGui.QPalette.Background
|
assert background_role == QtGui.QPalette.Background
|
||||||
|
|
||||||
palette = view.palette()
|
palette = view.palette()
|
||||||
|
|
||||||
|
if pg.Qt.QT_LIB in ["PySide2", "PyQt5"]:
|
||||||
assert palette.isBrushSet(QtGui.QPalette.Active, QtGui.QPalette.Background)
|
assert palette.isBrushSet(QtGui.QPalette.Active, QtGui.QPalette.Background)
|
||||||
assert palette.color(QtGui.QPalette.Background) == QtCore.Qt.transparent
|
assert palette.color(QtGui.QPalette.Background) == QtCore.Qt.transparent
|
||||||
assert view.backgroundBrush().color() == QtGui.QColor(0, 0, 0, 255)
|
assert view.backgroundBrush().color() == QtGui.QColor(0, 0, 0, 255)
|
||||||
@ -37,6 +39,8 @@ def test_basics_graphics_view():
|
|||||||
view.setBackground("w")
|
view.setBackground("w")
|
||||||
assert view._background == "w"
|
assert view._background == "w"
|
||||||
palette = view.palette()
|
palette = view.palette()
|
||||||
|
if pg.Qt.QT_LIB in ["PySide2", "PyQt5"]:
|
||||||
|
|
||||||
assert palette.isBrushSet(QtGui.QPalette.Active, QtGui.QPalette.Background)
|
assert palette.isBrushSet(QtGui.QPalette.Active, QtGui.QPalette.Background)
|
||||||
assert palette.color(QtGui.QPalette.Background) == QtCore.Qt.transparent
|
assert palette.color(QtGui.QPalette.Background) == QtCore.Qt.transparent
|
||||||
assert view.backgroundBrush().color() == QtCore.Qt.white
|
assert view.backgroundBrush().color() == QtCore.Qt.white
|
||||||
|
Loading…
Reference in New Issue
Block a user