File indexing completed on 2025-01-05 05:09:31
0001 /* 0002 SPDX-FileCopyrightText: 2012 Daniel Nicoletti <dantti12@gmail.com> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #include "NoSelectionRectDelegate.h" 0008 0009 NoSelectionRectDelegate::NoSelectionRectDelegate(QObject *parent) 0010 : QStyledItemDelegate(parent) 0011 { 0012 } 0013 0014 void NoSelectionRectDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const 0015 { 0016 // For some reason some styles don't honor the views SelectionRectVisible 0017 // and I just hate that selection rect thing... 0018 QStyleOptionViewItem opt(option); 0019 if (opt.state & QStyle::State_HasFocus) { 0020 opt.state ^= QStyle::State_HasFocus; 0021 } 0022 QStyledItemDelegate::paint(painter, opt, index); 0023 } 0024 0025 #include "moc_NoSelectionRectDelegate.cpp"