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
titleand pointer toparentobject.- Parameters:
title – Shortcut map title
parent – Pointer to parent object
-
virtual ~ShortcutMap() override = default
No need for custom destructor.
-
void setTitle(const QString &title)
Set shortcut map title to
title.- Parameters:
title – Shortcut map title
-
void addShortcut(const Shortcut &shortcut)
Add
shortcutto the map.- Parameters:
shortcut – Shortcut to add
-
void removeShortcut(const Shortcut &shortcut)
Remove
shortcutfrom the map.- Parameters:
shortcut – Shortcut 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
-
void titleChanged(const QString &title)
Signals that the shortcut map
titlehas changed.- Parameters:
title – Updated shortcut map title
-
void shortcutAdded(const Shortcut &shortcut)
Signals that
shortcutis added.- Parameters:
shortcut – Shortcut that is added
-
struct Shortcut