![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
#include <view_cities.h>
Inheritance diagram for city_model:
Collaboration diagram for city_model:Public Member Functions | |
| city_model (QObject *parent=0) | |
| Constructor for city model. More... | |
| ~city_model () override | |
| Destructor for city model. More... | |
| int | rowCount (const QModelIndex &index=QModelIndex()) const override |
| int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
| QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
| Returns stored data in index. More... | |
| bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::DisplayRole) override |
| Sets data in model under index. More... | |
| QVariant | headerData (int section, Qt::Orientation orientation, int role) const override |
| Returns header data for given section(column) More... | |
| QVariant | menu_data (int section) const |
| Returns header information about section. More... | |
| QVariant | hide_data (int section) const |
| Hides given column if show is false. More... | |
| void | populate () |
| Creates city model. More... | |
| void | city_changed (struct city *pcity) |
| Notifies about changed item. More... | |
| void | all_changed () |
| Notifies about whole model changed. More... | |
Private Slots | |
| void | notify_city_changed (int row) |
| Notifies about changed row. More... | |
Private Attributes | |
| QList< city_item * > | city_list |
Definition at line 86 of file view_cities.h.
| city_model::city_model | ( | QObject * | parent = 0 | ) |
Constructor for city model.
Definition at line 159 of file view_cities.cpp.
|
override |
Destructor for city model.
Definition at line 167 of file view_cities.cpp.
| void city_model::all_changed | ( | ) |
Notifies about whole model changed.
Definition at line 321 of file view_cities.cpp.
Referenced by city_widget::update_model().
| void city_model::city_changed | ( | struct city * | pcity | ) |
Notifies about changed item.
Definition at line 304 of file view_cities.cpp.
Referenced by city_widget::update_city().
|
inlineoverride |
Definition at line 98 of file view_cities.h.
Referenced by data(), city_widget::display_header_menu(), city_widget::hide_columns(), notify_city_changed(), and setData().
|
override |
Returns stored data in index.
Definition at line 184 of file view_cities.cpp.
|
override |
Returns header data for given section(column)
Definition at line 221 of file view_cities.cpp.
| QVariant city_model::hide_data | ( | int | section | ) | const |
Hides given column if show is false.
Definition at line 266 of file view_cities.cpp.
Referenced by city_widget::hide_columns().
| QVariant city_model::menu_data | ( | int | section | ) | const |
Returns header information about section.
Definition at line 252 of file view_cities.cpp.
Referenced by city_widget::display_header_menu().
|
privateslot |
Notifies about changed row.
Definition at line 176 of file view_cities.cpp.
Referenced by city_changed(), and setData().
| void city_model::populate | ( | ) |
Creates city model.
Definition at line 280 of file view_cities.cpp.
Referenced by all_changed(), and city_model().
|
inlineoverride |
Definition at line 93 of file view_cities.h.
Referenced by data(), city_widget::gen_production_labels(), and setData().
|
override |
Sets data in model under index.
Definition at line 199 of file view_cities.cpp.
|
private |
Definition at line 118 of file view_cities.h.
Referenced by all_changed(), city_changed(), data(), populate(), rowCount(), setData(), and ~city_model().