digiKam
Loading...
Searching...
No Matches
showfotothumbnailmodel.h
Go to the documentation of this file.
1/* ============================================================
2 *
3 * This file is a part of digiKam project
4 * https://www.digikam.org
5 *
6 * Date : 2013-07-22
7 * Description : Qt item model for Showfoto thumbnails entries
8 *
9 * SPDX-FileCopyrightText: 2013 by Mohamed_Anwer <m_dot_anwer at gmx dot com>
10 *
11 * SPDX-License-Identifier: GPL-2.0-or-later
12 *
13 * ============================================================ */
14
15#pragma once
16
17// Local Include
18
19#include "showfotoitemmodel.h"
20#include "thumbnailsize.h"
21#include "loadingdescription.h"
22#include "thumbnailloadthread.h"
23
24using namespace Digikam;
25
26namespace ShowFoto
27{
28
29typedef QPair<ShowfotoItemInfo, QPixmap> CachedItem;
30
32{
33 Q_OBJECT
34
35public:
36
43 explicit ShowfotoThumbnailModel(QWidget* const parent);
44 ~ShowfotoThumbnailModel() override;
45
52
56 void setThumbnailSize(const ThumbnailSize& thumbSize);
57
61 void setPreloadThumbnailSize(const ThumbnailSize& thumbSize);
62
63 void setExifRotate(bool rotate);
64
70 void setEmitDataChanged(bool emitSignal);
71
77 void setPreloadThumbnails(bool preload);
78
80
87 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
88
94 bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::DisplayRole) override;
95
96 bool pixmapForItem(const QString& url, QPixmap& pix) const;
97 bool getThumbnail(const ShowfotoItemInfo& itemInfo, QImage& thumbnail) const;
98
99public Q_SLOTS:
100
101 void slotThumbInfoLoaded(const ShowfotoItemInfo& info, const QImage& thumbnailImage);
102
103Q_SIGNALS:
104
105 void thumbnailAvailable(const QModelIndex& index, int requestedSize);
106 void thumbnailFailed(const QModelIndex& index, int requestedSize);
107
108 void signalThumbInfo(const ShowfotoItemInfo& info, const QImage& thumbnailImage) const; // clazy:exclude=const-signal-or-slot
109
110 void signalItemThumbnail(const ShowfotoItemInfo& info, const QPixmap& pix);
111
112protected:
113
114 void showfotoItemInfosCleared() override;
115
116protected Q_SLOTS:
117
118 void slotThumbnailLoaded(const LoadingDescription& loadingDescription,
119 const QPixmap& thumb);
120
121private:
122
123 // Disable
125 ShowfotoThumbnailModel& operator=(const ShowfotoThumbnailModel&) = delete;
126
127private:
128
129 class Private;
130 Private* const d = nullptr;
131};
132
133} // namespace ShowFoto
Definition loadingdescription.h:35
Definition thumbnailloadthread.h:36
Definition thumbnailsize.h:32
Definition showfotoiteminfo.h:38
Definition showfotoitemmodel.h:37
QModelIndex index(int row, int column, const QModelIndex &parent) const override
Definition showfotoitemmodel.cpp:623
Definition showfotothumbnailmodel.h:32
bool pixmapForItem(const QString &url, QPixmap &pix) const
Definition showfotothumbnailmodel.cpp:393
~ShowfotoThumbnailModel() override
Definition showfotothumbnailmodel.cpp:78
void signalThumbInfo(const ShowfotoItemInfo &info, const QImage &thumbnailImage) const
void showfotoItemInfosCleared() override
Definition showfotothumbnailmodel.cpp:120
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::DisplayRole) override
Definition showfotothumbnailmodel.cpp:193
ThumbnailSize thumbnailSize() const
Definition showfotothumbnailmodel.cpp:99
void slotThumbInfoLoaded(const ShowfotoItemInfo &info, const QImage &thumbnailImage)
Definition showfotothumbnailmodel.cpp:427
void setThumbnailLoadThread(ThumbnailLoadThread *thread)
Definition showfotothumbnailmodel.cpp:86
void setThumbnailSize(const ThumbnailSize &thumbSize)
Definition showfotothumbnailmodel.cpp:104
void slotThumbnailLoaded(const LoadingDescription &loadingDescription, const QPixmap &thumb)
Definition showfotothumbnailmodel.cpp:283
void setPreloadThumbnailSize(const ThumbnailSize &thumbSize)
Definition showfotothumbnailmodel.cpp:110
void thumbnailFailed(const QModelIndex &index, int requestedSize)
void thumbnailAvailable(const QModelIndex &index, int requestedSize)
void setPreloadThumbnails(bool preload)
bool getThumbnail(const ShowfotoItemInfo &itemInfo, QImage &thumbnail) const
Definition showfotothumbnailmodel.cpp:315
void signalItemThumbnail(const ShowfotoItemInfo &info, const QPixmap &pix)
ThumbnailLoadThread * thumbnailLoadThread() const
Definition showfotothumbnailmodel.cpp:94
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Definition showfotothumbnailmodel.cpp:128
void setEmitDataChanged(bool emitSignal)
Definition showfotothumbnailmodel.cpp:115
qulonglong value
Definition itemviewutilities.cpp:585
Definition datefolderview.cpp:34
Definition showfotofolderviewbar.cpp:43
QPair< ShowfotoItemInfo, QPixmap > CachedItem
Definition showfotothumbnailmodel.h:29