![]() |
Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
|
#include <shortcuts_settings.h>
Signals | |
| void | shortCutChanged () |
Public Member Functions | |
| ShortcutsSettings (const QString &settingsFilePath, QObject *parent=nullptr) | |
| ShortcutKey | getDefaultShortcut (const QString &name) const |
| ShortcutKey | getShortcut (const QString &name) const |
| QKeySequence | getSingleShortcut (const QString &name) const |
| QString | getDefaultShortcutString (const QString &name) const |
| QString | getShortcutString (const QString &name) const |
| QString | getShortcutFriendlyName (const QString &shortcutName) const |
| QList< QString > | getAllShortcutKeys () const |
| void | setShortcuts (const QString &name, const QList< QKeySequence > &Sequence) |
| void | setShortcuts (const QString &name, const QKeySequence &Sequence) |
| void | setShortcuts (const QString &name, const QString &sequences) |
| bool | isKeyAllowed (const QString &name, const QString &sequences) const |
| bool | isValid (const QString &name, const QString &sequences) const |
| QStringList | findOverlaps (const QString &name, const QString &sequences) const |
| void | resetAllShortcuts () |
| void | clearAllShortcuts () |
| void | migrateShortcuts () |
| Migrates legacy shortcut key names to current naming scheme. | |
Private Member Functions | |
| QString | stringifySequence (const QList< QKeySequence > &Sequence) const |
| QList< QKeySequence > | parseSequenceString (const QString &stringSequence) const |
Private Attributes | |
| const QChar | sep = ';' |
| const QString | custom = "Custom" |
| QString | settingsFilePath |
| QHash< QString, ShortcutKey > | shortCuts |
| const QHash< QString, ShortcutKey > | defaultShortCuts |
|
explicit |
| void ShortcutsSettings::clearAllShortcuts | ( | ) |
|
nodiscard |
|
inlinenodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
Gets the first shortcut for the given action.
NOTE: In most cases you should be using ShortcutsSettings::getShortcut instead, as that will return all shortcuts if there are multiple shortcuts. The only reason to use this method is if an object does not accept multiple shortcuts, such as with QButtons.
|
nodiscard |
|
nodiscard |
Checks that the shortcut doesn't overlap with an existing shortcut
| name | The name of the shortcut |
| sequences | The shortcut key sequence |
| void ShortcutsSettings::migrateShortcuts | ( | ) |
Migrates legacy shortcut key names to current naming scheme.
PR 5079 changed Textbox/unfocusTextBox to Player/unfocusTextBox and tab_game/aFocusChat to Player/aFocusChat. This migration allows players to keep their already configured shortcuts.
|
nodiscardprivate |
| void ShortcutsSettings::resetAllShortcuts | ( | ) |
| void ShortcutsSettings::setShortcuts | ( | const QString & | name, |
| const QKeySequence & | Sequence ) |
| void ShortcutsSettings::setShortcuts | ( | const QString & | name, |
| const QList< QKeySequence > & | Sequence ) |
| void ShortcutsSettings::setShortcuts | ( | const QString & | name, |
| const QString & | sequences ) |
|
signal |
|
nodiscardprivate |
|
private |
|
private |
|
private |
|
private |
|
private |