Freeciv-3.2
Loading...
Searching...
No Matches
Public Member Functions | Data Fields | Protected Member Functions | Private Slots | Private Attributes
unittype_item Class Reference

#include <repodlgs.h>

+ Inheritance diagram for unittype_item:

Public Member Functions

 unittype_item (QWidget *parent, unit_type *ut)
 
 ~unittype_item ()
 
void init_img ()
 

Data Fields

QLabel food_upkeep
 
QLabel gold_upkeep
 
QLabel label_info_active
 
QLabel label_info_inbuild
 
QLabel label_info_unit
 
QLabel shield_upkeep
 
QPushButton upgrade_button
 

Protected Member Functions

void enterEvent (QEnterEvent *event)
 
void leaveEvent (QEvent *event)
 
void paintEvent (QPaintEvent *event)
 
void wheelEvent (QWheelEvent *event)
 

Private Slots

void upgrade_units ()
 

Private Attributes

bool entered
 
int unit_scroll
 
QLabel label_pix
 
unit_typeutype
 

Detailed Description

Definition at line 48 of file repodlgs.h.

Constructor & Destructor Documentation

◆ unittype_item()

unittype_item::unittype_item ( QWidget *  parent,
unit_type ut 
)

Unit item constructor (single item for units report)

Definition at line 97 of file repodlgs.cpp.

◆ ~unittype_item()

unittype_item::~unittype_item ( )

Unit item destructor

Definition at line 183 of file repodlgs.cpp.

Member Function Documentation

◆ enterEvent()

void unittype_item::enterEvent ( QEnterEvent event)
protected

Mouse entered widget

Definition at line 240 of file repodlgs.cpp.

◆ init_img()

void unittype_item::init_img ( )

Sets unit type pixmap to label

Definition at line 190 of file repodlgs.cpp.

Referenced by unittype_item().

◆ leaveEvent()

void unittype_item::leaveEvent ( QEvent *  event)
protected

Mouse left widget

Definition at line 269 of file repodlgs.cpp.

◆ paintEvent()

void unittype_item::paintEvent ( QPaintEvent event)
protected

Paint event for unittype item ( draws background from theme )

Definition at line 252 of file repodlgs.cpp.

◆ upgrade_units

void unittype_item::upgrade_units ( )
privateslot

Popup question if to upgrade units

Definition at line 202 of file repodlgs.cpp.

Referenced by unittype_item().

◆ wheelEvent()

void unittype_item::wheelEvent ( QWheelEvent event)
protected

Mouse wheel event - cycles via units for given unittype

Definition at line 278 of file repodlgs.cpp.

Field Documentation

◆ entered

bool unittype_item::entered
private

Definition at line 52 of file repodlgs.h.

Referenced by leaveEvent(), paintEvent(), and unittype_item().

◆ food_upkeep

QLabel unittype_item::food_upkeep

Definition at line 60 of file repodlgs.h.

Referenced by unittype_item(), and units_reports::update_units().

◆ gold_upkeep

QLabel unittype_item::gold_upkeep

Definition at line 61 of file repodlgs.h.

Referenced by unittype_item(), and units_reports::update_units().

◆ label_info_active

QLabel unittype_item::label_info_active

Definition at line 62 of file repodlgs.h.

Referenced by unittype_item(), and units_reports::update_units().

◆ label_info_inbuild

QLabel unittype_item::label_info_inbuild

Definition at line 63 of file repodlgs.h.

Referenced by unittype_item(), and units_reports::update_units().

◆ label_info_unit

QLabel unittype_item::label_info_unit

Definition at line 64 of file repodlgs.h.

Referenced by unittype_item(), and units_reports::update_units().

◆ label_pix

QLabel unittype_item::label_pix
private

Definition at line 54 of file repodlgs.h.

Referenced by init_img(), and unittype_item().

◆ shield_upkeep

QLabel unittype_item::shield_upkeep

Definition at line 65 of file repodlgs.h.

Referenced by unittype_item(), and units_reports::update_units().

◆ unit_scroll

int unittype_item::unit_scroll
private

Definition at line 53 of file repodlgs.h.

Referenced by unittype_item(), and wheelEvent().

◆ upgrade_button

QPushButton unittype_item::upgrade_button

Definition at line 66 of file repodlgs.h.

Referenced by unittype_item(), and units_reports::update_units().

◆ utype

unit_type* unittype_item::utype
private

Definition at line 69 of file repodlgs.h.

Referenced by init_img(), unittype_item(), upgrade_units(), and wheelEvent().