Merge pull request #1383 from dgoeries/transparent-palette

GraphicsView: Set a transparent background palette
This commit is contained in:
Ogi Moore 2020-10-12 19:44:53 -07:00 committed by GitHub
commit 2955b26fb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -129,7 +129,12 @@ class GraphicsView(QtGui.QGraphicsView):
self.mouseEnabled = False self.mouseEnabled = False
self.scaleCenter = False ## should scaling center around view center (True) or mouse click (False) self.scaleCenter = False ## should scaling center around view center (True) or mouse click (False)
self.clickAccepted = False self.clickAccepted = False
# Set a transparent background QPalette!
palette = self.palette()
palette.setColor(QtGui.QPalette.Background, QtCore.Qt.transparent)
self.setPalette(palette)
def setAntialiasing(self, aa): def setAntialiasing(self, aa):
"""Enable or disable default antialiasing. """Enable or disable default antialiasing.
Note that this will only affect items that do not specify their own antialiasing options.""" Note that this will only affect items that do not specify their own antialiasing options."""