File indexing completed on 2024-04-21 04:56:57
0001 /** 0002 * SPDX-FileCopyrightText: 2020 Aniket Kumar <anikketkumar786@gmail.com> 0003 * 0004 * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0005 */ 0006 0007 #ifndef THUMBNAILSPROVIDER_H 0008 #define THUMBNAILSPROVIDER_H 0009 0010 #include <QQuickImageProvider> 0011 0012 class ThumbnailsProvider : public QQuickImageProvider 0013 { 0014 public: 0015 ThumbnailsProvider(); 0016 0017 QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize) override; 0018 0019 void addImage(const QString &id, const QImage &image); 0020 0021 void clear(); 0022 0023 private: 0024 QHash<QString, QImage> m_thumbnails; 0025 }; 0026 0027 #endif // THUMBNAILSPROVIDER_H