File indexing completed on 2024-05-19 04:29:28

0001 /*
0002  *  SPDX-FileCopyrightText: 2016 Dmitry Kazakov <dimula73@gmail.com>
0003  *
0004  *  SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 #ifndef __KIS_PALETTE_DELEGATE_H
0008 #define __KIS_PALETTE_DELEGATE_H
0009 
0010 #include <QAbstractItemDelegate>
0011 
0012 #include "kritawidgets_export.h"
0013 
0014 
0015 class KRITAWIDGETS_EXPORT KisPaletteDelegate : public QAbstractItemDelegate
0016 {
0017 private:
0018     static const int BORDER_WIDTH;
0019 public:
0020     KisPaletteDelegate(QObject * parent = 0);
0021     ~KisPaletteDelegate() override;
0022 
0023     void setCrossedKeyword(const QString &value)
0024     {
0025         m_crossedKeyword = value;
0026     }
0027 
0028     void paint(QPainter *, const QStyleOptionViewItem &, const QModelIndex &) const override;
0029     QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex &) const override;
0030 
0031 private:
0032     QString m_crossedKeyword;
0033 };
0034 
0035 #endif /* __KIS_PALETTE_DELEGATE_H */