Freeciv21
Develop your civilization from humble roots to a global empire
shortcut_edit Class Reference

#include <shortcuts.h>

+ Inheritance diagram for shortcut_edit:
+ Collaboration diagram for shortcut_edit:

Public Member Functions

 shortcut_edit (const fc_shortcut &sc)
 Constructs a shortcut edit widget. More...
 
fc_shortcut shortcut () const
 Retrieves the shortcut entered by the user. More...
 
void set_shortcut (const fc_shortcut &shortcut)
 Changes the shortcut displayed by the widget. More...
 

Protected Member Functions

bool event (QEvent *event) override
 Reimplemented from QObject. More...
 
bool eventFilter (QObject *watched, QEvent *event) override
 Mouse press event for shortcut edit widget. More...
 

Private Attributes

QLineEdit * m_line
 
fc_shortcut m_shortcut
 
bool m_ignore_next_mouse_event = false
 

Detailed Description

Definition at line 169 of file shortcuts.h.

Constructor & Destructor Documentation

◆ shortcut_edit()

shortcut_edit::shortcut_edit ( const fc_shortcut sc)

Constructs a shortcut edit widget.

Definition at line 396 of file shortcuts.cpp.

Member Function Documentation

◆ event()

bool shortcut_edit::event ( QEvent *  event)
overrideprotected

Reimplemented from QObject.

Definition at line 449 of file shortcuts.cpp.

Referenced by eventFilter().

◆ eventFilter()

bool shortcut_edit::eventFilter ( QObject *  watched,
QEvent *  event 
)
overrideprotected

Mouse press event for shortcut edit widget.

Definition at line 464 of file shortcuts.cpp.

◆ set_shortcut()

void shortcut_edit::set_shortcut ( const fc_shortcut shortcut)

Changes the shortcut displayed by the widget.

Definition at line 433 of file shortcuts.cpp.

◆ shortcut()

fc_shortcut shortcut_edit::shortcut ( ) const

Retrieves the shortcut entered by the user.

Definition at line 418 of file shortcuts.cpp.

Referenced by set_shortcut().

Member Data Documentation

◆ m_ignore_next_mouse_event

bool shortcut_edit::m_ignore_next_mouse_event = false
private

Definition at line 184 of file shortcuts.h.

Referenced by event(), and eventFilter().

◆ m_line

QLineEdit* shortcut_edit::m_line
private

Definition at line 182 of file shortcuts.h.

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

◆ m_shortcut

fc_shortcut shortcut_edit::m_shortcut
private

Definition at line 183 of file shortcuts.h.

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