document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #include "gridlinedelegate.h"
  2.  
  3. #include <QtGui>
  4.  
  5. GridLineDelegate::GridLineDelegate(QObject* parent)
  6.   : QStyledItemDelegate(parent)
  7. {
  8. }
  9.  
  10. void GridLineDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const
  11. {
  12.   QStyledItemDelegate::paint(painter, option, index);
  13.  
  14.   if (index.isValid())
  15.   {
  16.     painter->setPen(Qt::SolidLine);
  17.     painter->setPen(QColor(Qt::lightGray));
  18.  
  19.     painter->drawLine(QLine(option.rect.bottomLeft(), option.rect.bottomRight()));
  20.     painter->drawLine(QLine(option.rect.topRight(), option.rect.bottomRight()));
  21.   }
  22.  
  23. }
');