Freeciv21
Develop your civilization from humble roots to a global empire
fc_shortcut Struct Reference

#include <shortcuts.h>

Public Types

enum  type_id { keyboard , mouse }
 

Public Member Functions

QString to_string () const
 Returns shortcut as string (eg. More...
 
bool conflicts (const fc_shortcut &other) const
 
bool is_valid () const
 Checks if the shortcut can be used. More...
 

Public Attributes

shortcut_id id
 
type_id type
 
QKeySequence keys
 
Qt::MouseButton buttons
 
Qt::KeyboardModifiers modifiers
 
QString str
 

Detailed Description

Definition at line 100 of file shortcuts.h.

Member Enumeration Documentation

◆ type_id

Enumerator
keyboard 
mouse 

Definition at line 101 of file shortcuts.h.

Member Function Documentation

◆ conflicts()

bool fc_shortcut::conflicts ( const fc_shortcut other) const
inline

Definition at line 114 of file shortcuts.h.

Referenced by fc_shortcuts_dialog::shortcut_exists().

◆ is_valid()

bool fc_shortcut::is_valid ( ) const

Checks if the shortcut can be used.

Definition at line 215 of file shortcuts.cpp.

◆ to_string()

QString fc_shortcut::to_string ( ) const

Returns shortcut as string (eg.

for menu)

Definition at line 197 of file shortcuts.cpp.

Referenced by shortcut_edit::eventFilter(), shortcut_edit::set_shortcut(), and shortcut_edit::shortcut_edit().

Member Data Documentation

◆ buttons

Qt::MouseButton fc_shortcut::buttons

Definition at line 107 of file shortcuts.h.

Referenced by conflicts(), shortcut_edit::eventFilter(), is_valid(), and to_string().

◆ id

shortcut_id fc_shortcut::id

Definition at line 103 of file shortcuts.h.

Referenced by fc_shortcuts::set_shortcut().

◆ keys

◆ modifiers

Qt::KeyboardModifiers fc_shortcut::modifiers

Definition at line 108 of file shortcuts.h.

Referenced by conflicts(), shortcut_edit::eventFilter(), and to_string().

◆ str

QString fc_shortcut::str

Definition at line 110 of file shortcuts.h.

Referenced by fc_shortcuts_dialog::add_option().

◆ type