|
Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
|
Map picker model, tied to the current AreaMap. More...
#include <mapselectmodel.h>
Public Types | |
| enum | ItemRoles { IndRole = Qt::UserRole + 1 , NameRole } |
| Picker columns (mapped in roleNames()). More... | |
Public Member Functions | |
| MapSelectModel (AreaMap *map) | |
| virtual int | rowCount (const QModelIndex &parent) const override |
| Row count. | |
| virtual QVariant | data (const QModelIndex &index, int role) const override |
| Row+role value. | |
| virtual QHash< int, QByteArray > | roleNames () const override |
| Role -> QML name. | |
| int | mapToListIndex (int ind) |
Row index for map ind. | |
| void | rebuild () |
| Rebuild the cached list. | |
Public Attributes | |
| QVector< MapSelectEntry * > | mapListCache |
| Cached picker rows. | |
| AreaMap * | map |
| The live area map this picker targets. | |
Map picker model, tied to the current AreaMap.
Select-model variant (see SpeciesSelectModel) holding the live map so rebuild() can refresh against it; mapToListIndex() highlights the current map. Backs the "place player on a map" picker. Exposed as brg.mapSelectModel.
Definition at line 39 of file mapselectmodel.h.
Picker columns (mapped in roleNames()).
| Enumerator | |
|---|---|
| IndRole | |
| NameRole | |
Definition at line 45 of file mapselectmodel.h.
| MapSelectModel::MapSelectModel | ( | AreaMap * | map | ) |
| map | the live area map. |
Definition at line 35 of file mapselectmodel.cpp.
References AreaMap::curMapChanged(), map, and rebuild().
|
overridevirtual |
Row+role value.
Definition at line 54 of file mapselectmodel.cpp.
References IndRole, mapListCache, and NameRole.
| int MapSelectModel::mapToListIndex | ( | int | ind | ) |
| void MapSelectModel::rebuild | ( | ) |
Rebuild the cached list.
Definition at line 104 of file mapselectmodel.cpp.
References MapsDB::getIndAt(), MapsDB::inst(), map, and mapListCache.
Referenced by MapSelectModel().
|
overridevirtual |
Role -> QML name.
Definition at line 79 of file mapselectmodel.cpp.
|
overridevirtual |
| AreaMap* MapSelectModel::map |
The live area map this picker targets.
Definition at line 64 of file mapselectmodel.h.
Referenced by MapSelectModel(), and rebuild().
| QVector<MapSelectEntry*> MapSelectModel::mapListCache |
Cached picker rows.
Definition at line 56 of file mapselectmodel.h.
Referenced by data(), mapToListIndex(), rebuild(), and rowCount().