|
Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
|
Item picker model (select-model variant; see SpeciesSelectModel). More...
#include <itemselectmodel.h>
Public Types | |
| enum | ItemRoles { IndRole = Qt::UserRole + 1 , NameRole , InfoRole } |
| Picker columns (mapped in roleNames()). More... | |
Public Member Functions | |
| ItemSelectModel () | |
| 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 | itemToListIndex (int ind) |
Row index for item ind. | |
| QString | infoForInd (int ind) const |
Detailed-tooltip text for item ind (empty if none). | |
Public Attributes | |
| QVector< ItemSelectEntryData * > | itemListCache |
| Cached picker rows. | |
Item picker model (select-model variant; see SpeciesSelectModel).
Standard picker: cached rows + itemToListIndex() for combo highlighting. Exposed as brg.itemSelectModel.
Definition at line 38 of file itemselectmodel.h.
Picker columns (mapped in roleNames()).
| Enumerator | |
|---|---|
| IndRole | |
| NameRole | |
| InfoRole | |
Definition at line 44 of file itemselectmodel.h.
| ItemSelectModel::ItemSelectModel | ( | ) |
Definition at line 34 of file itemselectmodel.cpp.
References ItemsDB::inst(), and itemListCache.
|
overridevirtual |
Row+role value.
Definition at line 120 of file itemselectmodel.cpp.
References IndRole, infoForInd(), InfoRole, itemListCache, and NameRole.
| QString ItemSelectModel::infoForInd | ( | int | ind | ) | const |
Detailed-tooltip text for item ind (empty if none).
Definition at line 158 of file itemselectmodel.cpp.
References ItemsDB::getIndAt(), ItemDBEntry::getInfo(), and ItemsDB::inst().
Referenced by data().
| int ItemSelectModel::itemToListIndex | ( | int | ind | ) |
Row index for item ind.
Definition at line 166 of file itemselectmodel.cpp.
References itemListCache.
|
overridevirtual |
Role -> QML name.
Definition at line 147 of file itemselectmodel.cpp.
|
overridevirtual |
| QVector<ItemSelectEntryData*> ItemSelectModel::itemListCache |
Cached picker rows.
Definition at line 56 of file itemselectmodel.h.
Referenced by data(), ItemSelectModel(), itemToListIndex(), and rowCount().