![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
Displays the list of items supported by a city (improvements and units). More...
#include <upkeep_widget.h>
Inheritance diagram for freeciv::upkeep_widget:
Collaboration diagram for freeciv::upkeep_widget:Public Member Functions | |
| upkeep_widget (QWidget *parent=nullptr) | |
| Constructor. More... | |
| void | refresh () |
| Updates the widget from the city. More... | |
| void | set_city (int city_id) |
| Changes the city displayed by this widget. More... | |
| QSize | viewportSizeHint () const override |
| Reimplemented to provide a meaningful size hint. More... | |
| QSize | minimumSizeHint () const override |
| Reimplemented to allow for tiny tilesets. More... | |
Protected Member Functions | |
| void | contextMenuEvent (QContextMenuEvent *event) override |
| Reimplemented to provide the improvement and unit actions. More... | |
| bool | event (QEvent *event) override |
| Reimplemented to handle tileset changes. More... | |
Private Member Functions | |
| void | item_double_clicked (const QModelIndex &index) |
| Called when an item is double clicked. More... | |
Private Attributes | |
| int | m_city = -1 |
| QStandardItemModel * | m_model |
Displays the list of items supported by a city (improvements and units).
Definition at line 14 of file upkeep_widget.h.
|
explicit |
Constructor.
Definition at line 50 of file upkeep_widget.cpp.
|
overrideprotected |
Reimplemented to provide the improvement and unit actions.
Definition at line 176 of file upkeep_widget.cpp.
|
overrideprotected |
Reimplemented to handle tileset changes.
Definition at line 223 of file upkeep_widget.cpp.
Referenced by contextMenuEvent().
|
private |
Called when an item is double clicked.
Sells improvements and activates units.
Definition at line 236 of file upkeep_widget.cpp.
Referenced by upkeep_widget().
|
override |
Reimplemented to allow for tiny tilesets.
Definition at line 171 of file upkeep_widget.cpp.
| void freeciv::upkeep_widget::refresh | ( | ) |
Updates the widget from the city.
Definition at line 69 of file upkeep_widget.cpp.
Referenced by event(), and set_city().
| void freeciv::upkeep_widget::set_city | ( | int | city_id | ) |
Changes the city displayed by this widget.
Definition at line 147 of file upkeep_widget.cpp.
|
override |
Reimplemented to provide a meaningful size hint.
Definition at line 158 of file upkeep_widget.cpp.
|
private |
Definition at line 34 of file upkeep_widget.h.
Referenced by contextMenuEvent(), item_double_clicked(), refresh(), and set_city().
|
private |
Definition at line 35 of file upkeep_widget.h.
Referenced by contextMenuEvent(), item_double_clicked(), refresh(), upkeep_widget(), and viewportSizeHint().