mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-06 06:19:52 +08:00
18 lines
492 B
C++
18 lines
492 B
C++
#include "vnofocusitemdelegate.h"
|
|
|
|
VNoFocusItemDelegate::VNoFocusItemDelegate(QWidget *parent)
|
|
: QStyledItemDelegate(parent)
|
|
{
|
|
|
|
}
|
|
|
|
void VNoFocusItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
|
|
const QModelIndex &index) const
|
|
{
|
|
QStyleOptionViewItem itemOp(option);
|
|
if (itemOp.state & QStyle::State_HasFocus) {
|
|
itemOp.state ^= QStyle::State_HasFocus;
|
|
}
|
|
QStyledItemDelegate::paint(painter, itemOp, index);
|
|
}
|