Freeciv-3.1: unit_info Class Reference

Freeciv-3.1

Loading...
Searching...
No Matches
Public Member Functions | Data Fields | Protected Member Functions | Private Attributes
unit_info Class Reference

`#include <citydlg.h>`

Inheritance diagram for unit_info:

## Public Member Functions

| unit_info (bool supp)
| ~unit_info ()
void | add_item (unit_item *item)
void | init_layout ()
void | update_units ()
void | clear_layout ()

## Data Fields

QHBoxLayout * | layout
QList< unit_item * > | unit_list

## Protected Member Functions

void | wheelEvent (QWheelEvent *event)

## Private Attributes

bool | supports

## Detailed Description

Definition at line 196 of file citydlg.h.

## Constructor & Destructor Documentation

## ◆ unit_info()

unit_info::unit_info | ( | bool | supp | ) |

Class representing list of units ( unit_item 's)

Definition at line 1055 of file citydlg.cpp.

## ◆ ~unit_info()

unit_info::~unit_info | ( |  | ) |

Destructor for unit_info

Definition at line 1065 of file citydlg.cpp.

## Member Function Documentation

## ◆ add_item()

void unit_info::add_item | ( | unit_item * | item | ) |

Adds one unit to list

Definition at line 1074 of file citydlg.cpp.

Referenced by city_dialog::update_units().

## ◆ clear_layout()

void unit_info::clear_layout | ( |  | ) |

Cleans layout - run it before layout initialization

Definition at line 1160 of file citydlg.cpp.

Referenced by city_dialog::update_units(), and city_dialog::~city_dialog().

## ◆ init_layout()

void unit_info::init_layout | ( |  | ) |

Initializes layout ( layout needs to be changed after adding units )

Definition at line 1082 of file citydlg.cpp.

Referenced by unit_info().

## ◆ update_units()

void unit_info::update_units | ( |  | ) |

Updates units

Definition at line 1119 of file citydlg.cpp.

Referenced by city_dialog::update_units().

## ◆ wheelEvent()

void unit_info::wheelEvent | ( | QWheelEvent * | event | ) |

protected

Mouse wheel event - send it to scrollbar

Definition at line 1094 of file citydlg.cpp.

## Field Documentation

## ◆ layout

QHBoxLayout* unit_info::layout

Definition at line 208 of file citydlg.h.

Referenced by clear_layout(), init_layout(), unit_info(), and update_units().

## ◆ supports

bool unit_info::supports

private

Definition at line 212 of file citydlg.h.

Referenced by unit_info().

## ◆ unit_list

QList<unit_item *> unit_info::unit_list

Definition at line 209 of file citydlg.h.

Referenced by add_item(), clear_layout(), update_units(), and ~unit_info().