def drawBackground(self, painter, rect):
        """
        Draws the background for this scene.
        
        :param      painter | <QPainter>
                    rect    | <QRect>
        """
        if self._dirty:
            self.rebuild()
        
        # draw the alternating rects
        gantt   = self.ganttWidget()
        
        # draw the alternating rects
        painter.setPen(Qt.NoPen)
        painter.setBrush(gantt.alternateBrush())
        for rect in self._alternateRects:
            painter.drawRect(rect)
        
        # draw the weekends
        painter.setBrush(gantt.weekendBrush())
        for rect in self._weekendRects:
            painter.drawRect(rect)
        
        # draw the default background
        painter.setPen(gantt.gridPen())
        painter.drawLines(self._hlines + self._vlines)