File indexing completed on 2024-04-28 05:49:14
0001 /* 0002 SPDX-FileCopyrightText: 2011 Kåre Särs <kare.sars@iki.fi> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include <QFont> 0010 #include <QStyledItemDelegate> 0011 0012 class SearchResultsDelegate : public QStyledItemDelegate 0013 { 0014 Q_OBJECT 0015 0016 public: 0017 explicit SearchResultsDelegate(QObject *parent); 0018 0019 void paint(QPainter *, const QStyleOptionViewItem &, const QModelIndex &) const override; 0020 QSize sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const override; 0021 0022 private: 0023 void paintMatchItem(QPainter *, const QStyleOptionViewItem &, const QModelIndex &index) const; 0024 0025 QFont m_font; 0026 QColor m_textColor; 0027 QColor m_textColorLight; 0028 0029 QColor m_altBackground; 0030 QColor m_numBackground; 0031 0032 QColor m_borderColor; 0033 0034 QColor m_searchColor; 0035 QColor m_replaceColor; 0036 };