def _makePixmap(self, width, height): pixmap = QPixmap(width, height) style = self.brushComboBox.itemData( self.brushComboBox.currentIndex()).toInt()[0] brush = QBrush(self.color, Qt.BrushStyle(style)) painter = QPainter(pixmap) painter.fillRect(pixmap.rect(), Qt.white) painter.fillRect(pixmap.rect(), brush) return pixmap