Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
NatureSelectModel Class Reference

Nature picker model (select-model variant; see SpeciesSelectModel). More...

#include <natureselectmodel.h>

Inheritance diagram for NatureSelectModel:
Collaboration diagram for NatureSelectModel:

Public Types

enum  ItemRoles { IndRole = Qt::UserRole + 1 , NameRole }
 Picker columns (mapped in roleNames()). More...

Public Member Functions

 NatureSelectModel ()
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 natureToListIndex (int ind)
 Row index for nature ind.

Public Attributes

QVector< NatureSelectEntry * > natureListCache
 Cached picker rows.

Detailed Description

Nature picker model (select-model variant; see SpeciesSelectModel).

Standard picker: cached rows + natureToListIndex() for combo highlighting. Exposed as brg.natureSelectModel.

Definition at line 36 of file natureselectmodel.h.

Member Enumeration Documentation

◆ ItemRoles

Picker columns (mapped in roleNames()).

Enumerator
IndRole 
NameRole 

Definition at line 42 of file natureselectmodel.h.

Constructor & Destructor Documentation

◆ NatureSelectModel()

NatureSelectModel::NatureSelectModel ( )

Definition at line 32 of file natureselectmodel.cpp.

References natureListCache.

Member Function Documentation

◆ data()

QVariant NatureSelectModel::data ( const QModelIndex & index,
int role ) const
overridevirtual

Row+role value.

Definition at line 93 of file natureselectmodel.cpp.

References IndRole, NameRole, and natureListCache.

◆ natureToListIndex()

int NatureSelectModel::natureToListIndex ( int ind)

Row index for nature ind.

Definition at line 128 of file natureselectmodel.cpp.

References natureListCache.

◆ roleNames()

QHash< int, QByteArray > NatureSelectModel::roleNames ( ) const
overridevirtual

Role -> QML name.

Definition at line 118 of file natureselectmodel.cpp.

References IndRole, and NameRole.

◆ rowCount()

int NatureSelectModel::rowCount ( const QModelIndex & parent) const
overridevirtual

Row count.

Definition at line 84 of file natureselectmodel.cpp.

References natureListCache.

Member Data Documentation

◆ natureListCache

QVector<NatureSelectEntry*> NatureSelectModel::natureListCache

Cached picker rows.

Definition at line 53 of file natureselectmodel.h.

Referenced by data(), NatureSelectModel(), natureToListIndex(), and rowCount().


The documentation for this class was generated from the following files: