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

0001 /*
0002     SPDX-FileCopyrightText: 2009-2012 Stefan Majewsky <majewsky@gmx.net>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-only
0005 */
0006 
0007 #ifndef KG_THEMESELECTOR_P_H
0008 #define KG_THEMESELECTOR_P_H
0009 
0010 // Qt
0011 #include <QStyledItemDelegate>
0012 
0013 class KGameThemeDelegate : public QStyledItemDelegate
0014 {
0015 public:
0016     enum Roles {
0017         DescriptionRole = Qt::UserRole,
0018         AuthorRole,
0019         AuthorEmailRole,
0020         IdRole // not displayed, but used internally
0021     };
0022 
0023     explicit KGameThemeDelegate(QObject *parent = nullptr);
0024     void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
0025     /// @note The implementation is independent of @a option and @a index.
0026     QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override;
0027     QRect thumbnailRect(QRect baseRect) const;
0028 };
0029 
0030 #endif // KG_THEMESELECTOR_P_H