Krita Source Code Documentation
Loading...
Searching...
No Matches
KisResourceItemDelegate.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 * SPDX-FileCopyrightText: 2008 Jan Hambrecht <jaham@gmx.net>
3 * SPDX-FileCopyrightText: 2018 Boudewijn Rempt <boud@valdyas.org>
4 *
5 * SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7
8#ifndef KISRESOURCEITEMDELEGATE_H
9#define KISRESOURCEITEMDELEGATE_H
10
11#include <QAbstractItemDelegate>
12
15#include "kritaresourcewidgets_export.h"
16
18class KRITARESOURCEWIDGETS_EXPORT KisResourceItemDelegate : public QAbstractItemDelegate
19{
20 Q_OBJECT
21public:
22 explicit KisResourceItemDelegate(QObject *parent = 0);
24
25 void paint( QPainter *, const QStyleOptionViewItem &, const QModelIndex & ) const override;
26 void setShowText(bool);
27
35 void setNeedIndexConversion(bool value);
36
37 QSize sizeHint ( const QStyleOptionViewItem &, const QModelIndex & ) const override;
38
39private:
40 QModelIndex convertToGlobalModelIndexIfNeeded(const QModelIndex &localIndex) const;
41
42private:
47};
48
49#endif
float value(const T *src, size_t ch)
The resource item delegate for rendering the resource preview.
KisResourceThumbnailPainter m_thumbnailPainter
KoCheckerBoardPainter m_checkerPainter
The resource item delegate for rendering the resource preview.