Krita Source Code Documentation
Loading...
Searching...
No Matches
CommentModel.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2020 Saurabh Kumar <saurabhk660@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6#ifndef COMMENT_MODEL
7#define COMMENT_MODEL
8
9#include "StoryboardItem.h"
10
11#include <QAbstractListModel>
12#include <QAbstractButton>
13
14#include <kritastoryboarddocker_export.h>
15
16class StoryboardModel;
17
24class KRITASTORYBOARDDOCKER_EXPORT StoryboardCommentModel : public QAbstractListModel
25{
26
27 Q_OBJECT
28
29public:
30 StoryboardCommentModel(QObject *parent = 0);
31
32 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
33
34 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
35
36 Qt::ItemFlags flags(const QModelIndex &index) const override;
37 bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
38
39 bool insertRows(int position, int rows, const QModelIndex &index = QModelIndex()) override;
40 bool removeRows(int position, int rows, const QModelIndex &index = QModelIndex()) override;
41 bool moveRows(const QModelIndex &sourceParent, int sourceRow, int count,
42 const QModelIndex &destinationParent, int destinationChild) override;
43
44 QStringList mimeTypes() const override;
45 QMimeData *mimeData(const QModelIndexList &indexes) const override;
46 bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override;
47
48 Qt::DropActions supportedDropActions() const override;
49 Qt::DropActions supportedDragActions() const override;
50
55 void resetData(QVector<StoryboardComment> list);
61
62Q_SIGNALS:
69 //TODO: Use a signal compressor to reduce frequency
70private:
72 friend class StoryboardModel;
73};
74
75#endif
float value(const T *src, size_t ch)
void sigCommentListChanged()
Emitted whenever m_items is changed. it is used to keep the StoryboardItemList in KisDocument in sync...
QVector< StoryboardComment > m_commentList
The main storyboard model. This class manages a StoryboardItemList which is a list of StoryboardItem ...