Overloads the base QGraphicsScene method to handle \
        drawing the grid for the node scene.  This method should \
        not be called manually but is called internally as part \
        of the painting mechanism for the QGraphicsScene object.
        
        :param      painter     <QPainter>
        :param      rect        <QRect>

def drawBackground(self, painter, rect):
        """
        Overloads the base QGraphicsScene method to handle \
        drawing the grid for the node scene.  This method should \
        not be called manually but is called internally as part \
        of the painting mechanism for the QGraphicsScene object.
        
        :param      painter     <QPainter>
        :param      rect        <QRect>
        """
        painter.save()
        
        palette = self.palette()
        if not (self._mainView and self._mainView.isEnabled()):
            state = palette.Disabled
        else:
            state = palette.Active
        
        bg          = palette.color(state, palette.GridBackground)
        grid        = palette.color(state, palette.GridForeground)
        agrid       = palette.color(state, palette.GridAlternateForeground)
        lineColor   = palette.color(state, palette.GridCenterline)
        
        brush = self.backgroundBrush()
        brush.setColor(bg)
        
        painter.setBrush(brush)
        painter.drawRect(rect.x() - 1,
                         rect.y() - 1,
                         rect.width() + 2,
                         rect.height() + 2)
        
        # draw the grid if it is currently enabled
        if not self.showGrid():
            painter.restore()
            return
        
        # rebuild the grid if the scene is dirty
        if self.isDirty():
            self.rebuild()
        
        # if we're zoomed in above 50%, then draw the minor grid lines
        if self.zoomAmount() > 50:
            # draw the minor lines
            painter.setPen(agrid)
            painter.drawLines( self._minorLines )
        
        # draw the major grid lines
        painter.setPen(grid)
        painter.drawLines(self._majorLines)
        
        # draw the center lines
        painter.setPen(lineColor)
        painter.drawLines(self._centerLines)
        
        painter.restore()