Draws the grid lines for this delegate.
        
        :param      painter | <QtGui.QPainter>
                    opt     | <QtGui.QStyleOptionItem>
                    rect    | <QtCore.QRect>
                    index   | <QtGui.QModelIndex>

def drawGrid(self, painter, opt, rect, index):
        """
        Draws the grid lines for this delegate.
        
        :param      painter | <QtGui.QPainter>
                    opt     | <QtGui.QStyleOptionItem>
                    rect    | <QtCore.QRect>
                    index   | <QtGui.QModelIndex>
        """
        if not self.showGrid():
            return
        
        painter.setBrush(QtCore.Qt.NoBrush)
        painter.setPen(self.gridPen())
        
        size = self.gridPen().width() + 1
        
        # draw the lines
        lines = []
        
        # add the column line
        if self.showGridColumns():
            lines.append(QtCore.QLine(rect.width() - size, 
                                      0, 
                                      rect.width() - size, 
                                      rect.height() - size))
        
        # add the row line
        if (self.showGridRows()):
            lines.append(QtCore.QLine(0, 
                                      rect.height() - size, 
                                      rect.width() - size, 
                                      rect.height() - size))
        
        painter.drawLines(lines)