Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++
1.2 KB
Raw Blame
/* This file is part of the KDE project
 * SPDX-FileCopyrightText: 2008 Jan Hambrecht <[email protected]>
 * SPDX-FileCopyrightText: 2018 Boudewijn Rempt <[email protected]>
 *
 * SPDX-License-Identifier: LGPL-2.0-or-later
 */

#ifndef KIS_RESOURCE_THUMBNAIL_PAINTER_H
#define KIS_RESOURCE_THUMBNAIL_PAINTER_H

#include <QAbstractItemDelegate>

#include "KoCheckerBoardPainter.h"

#include "kritaresourcewidgets_export.h"
#include <KisResourceTypes.h>
#include <QObject>

/// The resource item delegate for rendering the resource preview
class KRITARESOURCEWIDGETS_EXPORT KisResourceThumbnailPainter : public QObject
{
    Q_OBJECT
public:
    explicit KisResourceThumbnailPainter(QObject *parent = 0);
    ~KisResourceThumbnailPainter() override {}

    //  (QPainter*, QModelIndex&, QRect, const QPalette&, bool)’

    QImage getReadyThumbnail(const QModelIndex& globalIndex, QSize rect, const QPalette& palette) const;
    void paint(QPainter *painter,
               const QModelIndex &index,
               QRect rect,
               const QPalette &palette,
               bool selected,
               bool addMargin) const;

private:
    KoCheckerBoardPainter m_checkerPainter;
};

#endif