ShortcutMap

Qualified name: mv::util::ShortcutMap

class ShortcutMap : public QObject

Shortcut map class.

Helper class for storing a map of categorized shortcuts and creating a shortcut cheatsheet overlay widget

Note: This class is developed for internal use only

Author

Thomas Kroes

Public Functions

explicit ShortcutMap(const QString &title = "", QObject *parent = nullptr)

Construct with title and pointer to parent object.

Parameters:
  • titleShortcut map title

  • parent – Pointer to parent object

virtual ~ShortcutMap() override = default

No need for custom destructor.

QString getTitle() const

Get shortcut map title.

Returns:

Shortcut map title

void setTitle(const QString &title)

Set shortcut map title to title.

Parameters:

titleShortcut map title

void addShortcut(const Shortcut &shortcut)

Add shortcut to the map.

Parameters:

shortcutShortcut to add

void removeShortcut(const Shortcut &shortcut)

Remove shortcut from the map.

Parameters:

shortcutShortcut to remove

Shortcuts getShortcuts(const QStringList &categories = QStringList()) const

Get shortcuts for categories.

Parameters:

categories – Categories to retrieve shortcuts for (all shortcuts if empty)

Returns:

Vector of shortcuts

bool hasShortcuts(const QStringList &categories = QStringList()) const

Establish whether any shortcut exists for categories.

Parameters:

categories – Categories to check (all categories if empty)

Returns:

Boolean determining whether any shortcut exists

QStringList getCategories() const

Get shortcut categories.

Returns:

Shortcut categories

void titleChanged(const QString &title)

Signals that the shortcut map title has changed.

Parameters:

title – Updated shortcut map title

void shortcutAdded(const Shortcut &shortcut)

Signals that shortcut is added.

Parameters:

shortcutShortcut that is added

void shortcutAboutToBeRemoved(const Shortcut &shortcut)

Signals that shortcut is about to be removed.

Parameters:

shortcutShortcut that is about to be removed

void shortcutRemoved(const Shortcut &shortcut)

Signals that shortcut is removed.

Parameters:

shortcutShortcut that is removed

struct Shortcut