Krita Source Code Documentation
Loading...
Searching...
No Matches
KisSnapshotModel.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2019 Tusooa Zhu <tusooa@vista.aero>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef KIS_SNAPSHOT_MODEL_H_
8#define KIS_SNAPSHOT_MODEL_H_
9
10#include <QAbstractListModel>
11#include <QScopedPointer>
12#include <QPointer>
13
14#include <kis_canvas2.h>
15
16class KisSnapshotModel : public QAbstractListModel
17{
18public:
20 ~KisSnapshotModel() override;
21
22 int rowCount(const QModelIndex &parent) const override;
23 QVariant data(const QModelIndex &index, int role) const override;
24 bool setData(const QModelIndex &index, const QVariant &value, int role) override;
25 // this function is re-implemented to make the items editable
26 Qt::ItemFlags flags(const QModelIndex &index) const override;
28
29public Q_SLOTS:
30 bool slotCreateSnapshot();
31 bool slotRemoveSnapshot(const QModelIndex &index);
32 bool slotSwitchToSnapshot(const QModelIndex &index);
33
34private:
35 struct Private;
36 QScopedPointer<Private> m_d;
37};
38
39#endif // KIS_SNAPSHOT_MODEL_H_
float value(const T *src, size_t ch)
bool slotRemoveSnapshot(const QModelIndex &index)
bool slotSwitchToSnapshot(const QModelIndex &index)
Qt::ItemFlags flags(const QModelIndex &index) const override
QVariant data(const QModelIndex &index, int role) const override
int rowCount(const QModelIndex &parent) const override
~KisSnapshotModel() override
bool setData(const QModelIndex &index, const QVariant &value, int role) override
QScopedPointer< Private > m_d
void setCanvas(QPointer< KisCanvas2 > canvas)