title: set QPainter background
body: <p>Hi every one I am working on using QPainter and mouse events and I want to set the background of the QPainter to black I used this code but doesn't work Thanks in advance </p>
  
  <pre><code>class Drawer(QWidget):
  
      newPoint = pyqtSignal(QPoint)
      def __init__(self, parent=None):
          QWidget.__init__(self, parent)
          self.path = QPainterPath()    
  
      def paintEvent(self, event):
          painter = QPainter(self)
          painter.setPen(QColor(168, 34, 3))
          painter.setFont(QFont('Decorative', 10))
          bbrush = QtGui.QBrush( QtGui.QColor(0,0,0),QtCore.Qt.SolidPattern)
          painter.setBackground(painter,bbrush)
          painter.drawPath(self.path)
  
      def mousePressEvent(self, event):
          self.path.moveTo(event.pos())
          self.update()
  
      def mouseMoveEvent(self, event):
          self.path.lineTo(event.pos())
          self.newPoint.emit(event.pos())
          self.update()
  
      def sizeHint(self):
          return QSize(400, 400)   
  </code></pre>
  
  <hr>
  
  <pre><code>class MyWidget(QWidget):
  
      def __init__(self, parent=None):
          QWidget.__init__(self, parent)
          self.setLayout(QVBoxLayout())
          label = QLabel(self)
          drawer = Drawer(self)
          drawer.newPoint.connect(lambda p: label.setText(
                          'Coordinates: ( %d : %d )' % (p.x(), p.y())))
          self.layout().addWidget(label)
          self.layout().addWidget(drawer)
  </code></pre>