File indexing completed on 2024-05-12 05:56:49
0001 /* 0002 SPDX-FileCopyrightText: 2008 Eike Hein <hein@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0005 */ 0006 0007 #ifndef SKINLISTDELEGATE_H 0008 #define SKINLISTDELEGATE_H 0009 0010 #include <QAbstractItemDelegate> 0011 0012 class SkinListDelegate : public QAbstractItemDelegate 0013 { 0014 public: 0015 explicit SkinListDelegate(QObject *parent = nullptr); 0016 ~SkinListDelegate(); 0017 0018 void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE; 0019 QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE; 0020 0021 private: 0022 void paintBackground(QPainter *painter, const QStyleOptionViewItem &option) const; 0023 void paintIcon(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; 0024 void paintText(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; 0025 }; 0026 0027 #endif