def rebuildGrid( self ):
        """
        Rebuilds the ruler data.
        """
        vruler = self.verticalRuler()
        hruler = self.horizontalRuler()
        
        rect   = self._buildData['grid_rect']
        
        # process the vertical ruler
        h_lines     = []
        h_alt       = []
        h_notches   = []
        
        vpstart  = vruler.padStart()
        vnotches = vruler.notches()
        vpend    = vruler.padEnd()
        vcount   = len(vnotches) + vpstart + vpend
        deltay   = rect.height() / max((vcount - 1), 1)
        y        = rect.bottom()
        alt      = False
        
        for i in range(vcount):
            h_lines.append(QLineF(rect.left(), y, rect.right(), y))
            
            # store alternate color
            if ( alt ):
                alt_rect = QRectF(rect.left(), y, rect.width(), deltay)
                h_alt.append(alt_rect)
            
            # store notch information
            nidx = i - vpstart
            if ( 0 <= nidx and nidx < len(vnotches) ):
                notch = vnotches[nidx]
                notch_rect = QRectF(0, y - 3, rect.left() - 3, deltay)
                h_notches.append((notch_rect, notch))
            
            y -= deltay
            alt = not alt
        
        self._buildData['grid_h_lines']     = h_lines
        self._buildData['grid_h_alt']       = h_alt
        self._buildData['grid_h_notches']   = h_notches
        
        # process the horizontal ruler
        v_lines     = []
        v_alt       = []
        v_notches   = []
        
        hpstart     = hruler.padStart()
        hnotches    = hruler.notches()
        hpend       = hruler.padEnd()
        hcount      = len(hnotches) + hpstart + hpend
        deltax      = rect.width() / max((hcount - 1), 1)
        x           = rect.left()
        alt         = False
        
        for i in range(hcount):
            v_lines.append(QLineF(x, rect.top(), x, rect.bottom()))
            
            # store alternate info
            if ( alt ):
                alt_rect = QRectF(x - deltax, rect.top(), deltax, rect.height())
                v_alt.append(alt_rect)
            
            # store notch information
            nidx = i - hpstart
            if ( 0 <= nidx and nidx < len(hnotches) ):
                notch = hnotches[nidx]
                notch_rect = QRectF(x - (deltax / 2.0), 
                                    rect.bottom() + 3, 
                                    deltax, 
                                    13)
                v_notches.append((notch_rect, notch))
            
            x += deltax
            alt = not alt
        
        self._buildData['grid_v_lines']     = v_lines
        self._buildData['grid_v_alt']       = v_alt
        self._buildData['grid_v_notches']   = v_notches
        
        # draw the axis lines
        axis_lines = []
        axis_lines.append(QLineF(rect.left(), 
                                 rect.top(), 
                                 rect.left(), 
                                 rect.bottom()))
                                 
        axis_lines.append(QLineF(rect.left(), 
                                 rect.bottom(), 
                                 rect.right(), 
                                 rect.bottom()))
        
        self._buildData['axis_lines'] = axis_lines