|
Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
|
The three canonical starters as a picker model. More...
#include <pokemonstartersmodel.h>
Public Types | |
| enum | PokemonStarterRoles { IndRole = Qt::UserRole + 1 , NameRole } |
| Columns (mapped in roleNames()). More... | |
Public Member Functions | |
| virtual int | rowCount (const QModelIndex &parent) const override |
| Row count (3). | |
| virtual QVariant | data (const QModelIndex &index, int role) const override |
| Row+role value. | |
| virtual QHash< int, QByteArray > | roleNames () const override |
| Role -> QML name. | |
| int | valToIndex (int val) |
Row index for species value val. | |
| PokemonDBEntry * | getMon (int ind) const |
DB entry for row ind. | |
Public Attributes | |
| QString | starters [3] |
| The three canonical starter species. | |
The three canonical starters as a picker model.
A tiny fixed list model (see CreditsModel) over starters. valToIndex() maps a species value to its row; getMon() resolves a row to its DB entry. Exposed as brg.starterModel.
Definition at line 30 of file pokemonstartersmodel.h.
Columns (mapped in roleNames()).
| Enumerator | |
|---|---|
| IndRole | |
| NameRole | |
Definition at line 36 of file pokemonstartersmodel.h.
|
overridevirtual |
Row+role value.
Definition at line 34 of file pokemonstartersmodel.cpp.
| PokemonDBEntry * PokemonStartersModel::getMon | ( | int | ind | ) | const |
DB entry for row ind.
Definition at line 100 of file pokemonstartersmodel.cpp.
References PokemonDB::getIndAt(), PokemonDB::inst(), and starters.
Referenced by data().
|
overridevirtual |
Role -> QML name.
Definition at line 70 of file pokemonstartersmodel.cpp.
|
overridevirtual |
Row count (3).
Definition at line 25 of file pokemonstartersmodel.cpp.
| int PokemonStartersModel::valToIndex | ( | int | val | ) |
Row index for species value val.
Definition at line 80 of file pokemonstartersmodel.cpp.
References PokemonDB::getIndAt(), and PokemonDB::inst().
| QString PokemonStartersModel::starters[3] |
The three canonical starter species.
Definition at line 42 of file pokemonstartersmodel.h.
Referenced by getMon().