Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_action_shortcuts_model.h
Go to the documentation of this file.
1/*
2 * This file is part of the KDE project
3 * SPDX-FileCopyrightText: 2013 Arjen Hiemstra <ahiemstra@heimr.nl>
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 */
7
8#ifndef KISACTIONSHORTCUTSMODEL_H
9#define KISACTIONSHORTCUTSMODEL_H
10
11#include <QAbstractListModel>
12
14class KisInputProfile;
15
30class KisActionShortcutsModel : public QAbstractListModel
31{
32 Q_OBJECT
33public:
37 explicit KisActionShortcutsModel(QObject *parent = 0);
41 ~KisActionShortcutsModel() override;
42
46 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
50 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
54 int columnCount(const QModelIndex &) const override;
58 QVariant headerData(int section, Qt::Orientation orientation, int role =
59 Qt::DisplayRole) const override;
63 Qt::ItemFlags flags(const QModelIndex &index) const override;
67 bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
68
77 bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
78
86 KisInputProfile *profile() const;
87
88 bool canRemoveRow(int row) const;
89
90public Q_SLOTS:
103
104private Q_SLOTS:
106
107private:
108 class Private;
109 Private *const d;
110};
111
112#endif // KISACTIONSHORTCUTSMODEL_H
float value(const T *src, size_t ch)
Abstract base class for input actions.
A QAbstractListModel subclass that lists shortcuts associated with an action from a profile.
void setProfile(KisInputProfile *profile)
void setAction(KisAbstractInputAction *action)
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
int rowCount(const QModelIndex &parent=QModelIndex()) const override
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
KisInputProfile * profile() const
int columnCount(const QModelIndex &) const override
KisAbstractInputAction * action() const
bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex()) override
Qt::ItemFlags flags(const QModelIndex &index) const override
A container class for sets of shortcuts associated with an action.