blanchoir
28th July 2011, 01:35
When drawing a rounded rectangle then applying it as the windows shape using
def resizeEvent(self, event):
pixmap = QtGui.QPixmap(self.size())
pixmap.fill(QtCore.Qt.transparent)
painter = QtGui.QPainter(pixmap)
painter.setBrush(QtCore.Qt.black)
painter.drawRoundedRect(pixmap.rect(), 8, 8)
painter.end()
self.setMask(pixmap.mask())
It comes out very poor quality, and it seems that I should be using OPENGl or is there is a way to have it set to HighQualityAntialiasing
def resizeEvent(self, event):
pixmap = QtGui.QPixmap(self.size())
pixmap.fill(QtCore.Qt.transparent)
painter = QtGui.QPainter(pixmap)
painter.setBrush(QtCore.Qt.black)
painter.drawRoundedRect(pixmap.rect(), 8, 8)
painter.end()
self.setMask(pixmap.mask())
It comes out very poor quality, and it seems that I should be using OPENGl or is there is a way to have it set to HighQualityAntialiasing