And one more question I'd like to ask. I don't know if this is the right topic so don't blame me too much

The problem is when I click on a row in my table widget it becomes highlighted but when I use delegates it is not. I've tried to do like this
Qt Code:
  1. if (table->currentRow() == index.row())
  2. {
  3. painter->setBrush(QBrush(QColor("#444444")));
  4. painter->drawRect(opt.rect);
  5. }
To copy to clipboard, switch view to plain text mode 
but it didn't work the way I thought. Also I've tried to use setBackground with QPainter and that didn't work either