vnofocusitemdelegate.cpp 492 B

1234567891011121314151617
  1. #include "vnofocusitemdelegate.h"
  2. VNoFocusItemDelegate::VNoFocusItemDelegate(QWidget *parent)
  3. : QStyledItemDelegate(parent)
  4. {
  5. }
  6. void VNoFocusItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
  7. const QModelIndex &index) const
  8. {
  9. QStyleOptionViewItem itemOp(option);
  10. if (itemOp.state & QStyle::State_HasFocus) {
  11. itemOp.state ^= QStyle::State_HasFocus;
  12. }
  13. QStyledItemDelegate::paint(painter, itemOp, index);
  14. }