How to prevent painting bottom border for some cells in QTableView
Solved
General and Desktop
-
I have one column in a QTableView in which I do not want to have any grid lines painted. Is this possible?
Thanks
-
Hi
As far as i know, you can only default disable whole grid
setShowGrid(false);
However, you can use a Delegate and paint the cells borders yourself and
then that way avoid painting for some.class MyDelegate : public QItemDelegate { public: MyDelegate( QObject *parent ) : QItemDelegate( parent ) { } void paint( QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const { QItemDelegate::paint( painter, option, index ); if( /* some condition */ ) { painter->setPen( Qt::red ); painter->drawRect( option.rect ); } } }