I want to draw grid lines for only some boxes in my QTableView. For this I have implemented a delegate that draws the lines. This all works however when I draw the lines they are thick and black. How do I get a hold of the default settings for the grid lines from my view that way I can make it look like all my other QTableview grid lines? My code is below.
Qt Code:
  1. class setup_delegate(QtGui.QStyledItemDelegate):
  2.  
  3.  
  4. def __init__(self, parent=None):
  5. super(setup_delegate, self).__init__(parent)
  6.  
  7. def paint(self, painter, option, index):
  8. if index.data().toBool() or index.row() == 0:
  9. painter.save()
  10. painter.drawRect(option.rect)
  11. painter.restore()
  12. QtGui.QStyledItemDelegate.paint(self, painter, option, index)
To copy to clipboard, switch view to plain text mode