|
Krita Source Code Documentation
|
A QAbstractListModel subclass that lists shortcuts associated with an action from a profile. More...
#include <kis_action_shortcuts_model.h>
Inheritance diagram for KisActionShortcutsModel:Classes | |
| class | Private |
Public Slots | |
| void | setAction (KisAbstractInputAction *action) |
| void | setProfile (KisInputProfile *profile) |
Public Member Functions | |
| KisAbstractInputAction * | action () const |
| bool | canRemoveRow (int row) const |
| int | columnCount (const QModelIndex &) const override |
| QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
| Qt::ItemFlags | flags (const QModelIndex &index) const override |
| QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override |
| KisActionShortcutsModel (QObject *parent=0) | |
| KisInputProfile * | profile () const |
| bool | removeRows (int row, int count, const QModelIndex &parent=QModelIndex()) override |
| int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
| bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override |
| ~KisActionShortcutsModel () override | |
Private Slots | |
| void | currentProfileChanged () |
Private Attributes | |
| Private *const | d |
A QAbstractListModel subclass that lists shortcuts associated with an action from a profile.
This class lists all shortcuts from the set profile that correspond to a specific action. This is used to allow editing of shortcuts from the ui.
It defines the following columns:
Definition at line 30 of file kis_action_shortcuts_model.h.
|
explicit |
Constructor.
Definition at line 40 of file kis_action_shortcuts_model.cpp.
References connect(), currentProfileChanged(), and KisInputProfileManager::instance().
|
override |
| KisAbstractInputAction * KisActionShortcutsModel::action | ( | ) | const |
Definition at line 296 of file kis_action_shortcuts_model.cpp.
References KisActionShortcutsModel::Private::action, and d.
| bool KisActionShortcutsModel::canRemoveRow | ( | int | row | ) | const |
Definition at line 218 of file kis_action_shortcuts_model.cpp.
References KisActionShortcutsModel::Private::action, d, KisAbstractInputAction::isShortcutRequired(), KisShortcutConfiguration::mode(), KisActionShortcutsModel::Private::shortcutModeCount(), and KisActionShortcutsModel::Private::shortcuts.
|
override |
Reimplemented from QAbstractItemModel::columnCount()
Definition at line 168 of file kis_action_shortcuts_model.cpp.
|
privateslot |
Definition at line 342 of file kis_action_shortcuts_model.cpp.
References KisInputProfileManager::instance(), and setProfile().
|
override |
Reimplemented from QAbstractItemModel::data()
Definition at line 50 of file kis_action_shortcuts_model.cpp.
References KisActionShortcutsModel::Private::action, KisShortcutConfiguration::buttons(), KisShortcutConfiguration::buttonsInputToText(), d, KisShortcutConfiguration::gesture(), KisShortcutConfiguration::gestureToText(), KisShortcutConfiguration::GestureType, KisShortcutConfiguration::KeyCombinationType, KisShortcutConfiguration::keys(), KisShortcutConfiguration::keysToText(), KisIconUtils::loadIcon(), KisShortcutConfiguration::mode(), KisShortcutConfiguration::MouseButtonType, KisShortcutConfiguration::MouseWheelType, KisAbstractInputAction::shortcutIndexes(), KisActionShortcutsModel::Private::shortcuts, KisActionShortcutsModel::Private::temporaryShortcut, KisShortcutConfiguration::type(), KisShortcutConfiguration::wheel(), and KisShortcutConfiguration::wheelInputToText().
|
override |
Reimplemented from QAbstractItemModel::flags()
Definition at line 196 of file kis_action_shortcuts_model.cpp.
References KisActionShortcutsModel::Private::action, d, KisAbstractInputAction::isShortcutRequired(), KisShortcutConfiguration::mode(), KisActionShortcutsModel::Private::shortcutModeCount(), and KisActionShortcutsModel::Private::shortcuts.
|
override |
Reimplemented from QAbstractItemModel::headerData()
Definition at line 173 of file kis_action_shortcuts_model.cpp.
| KisInputProfile * KisActionShortcutsModel::profile | ( | ) | const |
Definition at line 319 of file kis_action_shortcuts_model.cpp.
References d, and KisActionShortcutsModel::Private::profile.
|
override |
Reimplemented from QAbstractItemModel::removeRows.
Removes count rows starting at row.
Definition at line 347 of file kis_action_shortcuts_model.cpp.
References d, KisActionShortcutsModel::Private::profile, KisInputProfile::removeShortcut(), and KisActionShortcutsModel::Private::shortcuts.
|
override |
Reimplemented from QAbstractItemModel::rowCount()
Definition at line 159 of file kis_action_shortcuts_model.cpp.
References d, and KisActionShortcutsModel::Private::shortcuts.
|
slot |
Set the action used as data constraint for this model.
| action | The action to use. |
Definition at line 301 of file kis_action_shortcuts_model.cpp.
References KisActionShortcutsModel::Private::action, action(), d, KisActionShortcutsModel::Private::profile, KisActionShortcutsModel::Private::shortcuts, and KisInputProfile::shortcutsForAction().
|
override |
Reimplemented from QAbstractItemModel::setData()
Definition at line 227 of file kis_action_shortcuts_model.cpp.
References KisActionShortcutsModel::Private::action, KisInputProfile::addShortcut(), KisShortcutConfiguration::buttons(), d, KisShortcutConfiguration::gesture(), KisInputProfileManager::getConflictingShortcuts(), KisInputProfileManager::instance(), KisShortcutConfiguration::keys(), KisActionShortcutsModel::Private::profile, KisShortcutConfiguration::setAction(), KisActionShortcutsModel::Private::shortcuts, KisActionShortcutsModel::Private::temporaryShortcut, value(), and KisShortcutConfiguration::wheel().
|
slot |
Set the profile used as data source for this model.
| profile | The profile to get the data from. |
Definition at line 324 of file kis_action_shortcuts_model.cpp.
References KisActionShortcutsModel::Private::action, d, KisActionShortcutsModel::Private::profile, profile(), KisActionShortcutsModel::Private::shortcuts, and KisInputProfile::shortcutsForAction().
|
private |
Definition at line 109 of file kis_action_shortcuts_model.h.