Krita Source Code Documentation
Loading...
Searching...
No Matches
KisRecentDocumentsModelWrapper.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2021 Felipe Lema <felipelema@mortemale.org>
3 * SPDX-FileCopyrightText: 2022 Alvin Wong <alvin@alvinhc.com>
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 */
7
8#ifndef KISRECENTDOCUMENTSMODELWRAPPER_H
9#define KISRECENTDOCUMENTSMODELWRAPPER_H
10
11#include <QStandardItemModel>
12
13class QString;
14class QIcon;
15
26class KisRecentDocumentsModelWrapper : public QObject
27{
28 Q_OBJECT
29public:
30 static constexpr const int DEFALT_ICON_SIZE_LENGTH = 200;
31 static constexpr const int MAX_ICON_SIZE_LENGTH = 300;
32
34
35private:
38
42 void setFiles(const QList<QUrl> &urls);
43
44public:
50 QStandardItemModel &model();
51
52private:
53 QStandardItemModel m_filesAndThumbnailsModel;
54
55private Q_SLOTS:
56 void slotFileIconChanged(const QUrl &url, const QIcon &icon);
57 void fileAdded(const QUrl &url);
58 void fileRemoved(const QUrl &url);
59 void listRenewed();
60
61Q_SIGNALS:
66}; // class KisRecentDocumentsModelWrapper
67
68#endif // KISRECENTDOCUMENTSMODELWRAPPER_H
static constexpr const int DEFALT_ICON_SIZE_LENGTH
void slotFileIconChanged(const QUrl &url, const QIcon &icon)
static constexpr const int MAX_ICON_SIZE_LENGTH
static KisRecentDocumentsModelWrapper * instance()