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

#include <hudwidget.h>

+ Inheritance diagram for hud_action:
+ Collaboration diagram for hud_action:

Signals

void left_clicked ()
 
void right_clicked ()
 

Public Member Functions

 hud_action (QWidget *parent, const QIcon &icon, shortcut_id shortcut)
 Hud action constructor, used to show one action. More...
 
 ~hud_action () override
 Hud action destructor. More...
 

Public Attributes

shortcut_id action_shortcut
 

Protected Member Functions

void paintEvent (QPaintEvent *event) override
 Custom painting for hud_action. More...
 
void mousePressEvent (QMouseEvent *e) override
 Mouse press event for hud_action. More...
 
void mouseMoveEvent (QMouseEvent *event) override
 Mouse move event for hud_action, draw focus. More...
 
void leaveEvent (QEvent *event) override
 Leave event for hud_action, used to get status of pixmap higlight. More...
 
void enterEvent (QEvent *event) override
 Enter event for hud_action, used to get status of pixmap higlight. More...
 

Private Slots

void mouse_clicked ()
 Left click event for hud_action. More...
 
void mouse_right_clicked ()
 Right click event for hud_action. More...
 

Private Attributes

const QIcon icon
 
bool focus
 

Detailed Description

Definition at line 157 of file hudwidget.h.

Constructor & Destructor Documentation

◆ hud_action()

hud_action::hud_action ( QWidget *  parent,
const QIcon &  icon,
shortcut_id  shortcut 
)

Hud action constructor, used to show one action.

Definition at line 804 of file hudwidget.cpp.

◆ ~hud_action()

hud_action::~hud_action ( )
override

Hud action destructor.

Definition at line 833 of file hudwidget.cpp.

Member Function Documentation

◆ enterEvent()

void hud_action::enterEvent ( QEvent *  event)
overrideprotected

Enter event for hud_action, used to get status of pixmap higlight.

Definition at line 869 of file hudwidget.cpp.

◆ leaveEvent()

void hud_action::leaveEvent ( QEvent *  event)
overrideprotected

Leave event for hud_action, used to get status of pixmap higlight.

Definition at line 859 of file hudwidget.cpp.

◆ left_clicked

void hud_action::left_clicked ( )
signal

Referenced by hud_action(), and mousePressEvent().

◆ mouse_clicked

void hud_action::mouse_clicked ( )
privateslot

Left click event for hud_action.

Definition at line 884 of file hudwidget.cpp.

Referenced by hud_action().

◆ mouse_right_clicked

void hud_action::mouse_right_clicked ( )
privateslot

Right click event for hud_action.

Definition at line 879 of file hudwidget.cpp.

◆ mouseMoveEvent()

void hud_action::mouseMoveEvent ( QMouseEvent *  event)
overrideprotected

Mouse move event for hud_action, draw focus.

Definition at line 850 of file hudwidget.cpp.

◆ mousePressEvent()

void hud_action::mousePressEvent ( QMouseEvent *  e)
overrideprotected

Mouse press event for hud_action.

Definition at line 838 of file hudwidget.cpp.

◆ paintEvent()

void hud_action::paintEvent ( QPaintEvent *  event)
overrideprotected

Custom painting for hud_action.

Definition at line 817 of file hudwidget.cpp.

◆ right_clicked

void hud_action::right_clicked ( )
signal

Referenced by mousePressEvent().

Member Data Documentation

◆ action_shortcut

shortcut_id hud_action::action_shortcut

Definition at line 165 of file hudwidget.h.

Referenced by mouse_clicked().

◆ focus

bool hud_action::focus
private

Definition at line 160 of file hudwidget.h.

Referenced by enterEvent(), hud_action(), leaveEvent(), mouseMoveEvent(), and paintEvent().

◆ icon

const QIcon hud_action::icon
private

Definition at line 159 of file hudwidget.h.

Referenced by paintEvent().