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

Recent-files list model for the start screen. More...

#include <recentfilesmodel.h>

Inheritance diagram for RecentFilesModel:
Collaboration diagram for RecentFilesModel:

Public Types

enum  RecentFileRoles { PathRole = Qt::UserRole + 1 , EnabledRole , FileIndexRole }
 Columns (mapped in roleNames()). More...

Public Member Functions

 RecentFilesModel (FileManagement *file)
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.

Detailed Description

Recent-files list model for the start screen.

Wraps FileManagement's recent-files list (see CreditsModel for the convention), shortening each path for display and tracking enabled/index per row. Exposed as brg.recentFilesModel.

Definition at line 29 of file recentfilesmodel.h.

Member Enumeration Documentation

◆ RecentFileRoles

Columns (mapped in roleNames()).

Enumerator
PathRole 
EnabledRole 
FileIndexRole 

Definition at line 35 of file recentfilesmodel.h.

Constructor & Destructor Documentation

◆ RecentFilesModel()

RecentFilesModel::RecentFilesModel ( FileManagement * file)
Parameters
filethe file controller.

Definition at line 29 of file recentfilesmodel.cpp.

References FileManagement::recentFilesChanged().

Member Function Documentation

◆ data()

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

Row+role value.

Definition at line 43 of file recentfilesmodel.cpp.

References EnabledRole, FileIndexRole, and PathRole.

◆ roleNames()

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

Role -> QML name.

Definition at line 74 of file recentfilesmodel.cpp.

References EnabledRole, FileIndexRole, and PathRole.

◆ rowCount()

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

Row count.

Definition at line 34 of file recentfilesmodel.cpp.


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