Atlas Game Manager
A game manager for f95 and dlsite written in c++
Loading...
Searching...
No Matches
RecordListModel Class Referencefinal

#include <RecordListModel.hpp>

Inheritance diagram for RecordListModel:

Public Types

enum  RecordListModelRoles {
  Raw = Qt::ItemDataRole::UserRole , NormalBanner , WideBanner , LogoBanner ,
  CoverBanner
}
 

Public Slots

void setRecords (std::vector< atlas::records::Game > records)
 
void addRecord (atlas::records::Game record, const std::size_t place_at=0)
 
void removeRecord (QPersistentModelIndex index)
 
void reloadRecord (QPersistentModelIndex index)
 

Signals

void recordsChanged (std::vector< atlas::records::Game > records)
 
void emitReloadRecord (QPersistentModelIndex index)
 

Public Member Functions

 RecordListModel (QObject *parent=nullptr)
 
QVariant headerData (int section, Qt::Orientation orientation, int role) const override
 
int rowCount (const QModelIndex &index=QModelIndex()) const override
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 
void refreshOnFuture (QPersistentModelIndex index, QFuture< QPixmap >)
 
void killLoaders ()
 

Private Attributes

std::vector< atlas::records::Gamem_records {}
 
QThread loading_thread {}
 
std::unordered_map< int, std::unique_ptr< atlas::images::ImageLoader > > loaders {}
 

Member Enumeration Documentation

◆ RecordListModelRoles

Enumerator
Raw 
NormalBanner 
WideBanner 
LogoBanner 
CoverBanner 

Constructor & Destructor Documentation

◆ RecordListModel()

RecordListModel::RecordListModel ( QObject * parent = nullptr)
inline

Member Function Documentation

◆ addRecord

void RecordListModel::addRecord ( atlas::records::Game record,
const std::size_t place_at = 0 )
slot
Parameters
record
place_atwhere to place in the list (place_at > m_records.size()) will place at the end

◆ data()

QVariant RecordListModel::data ( const QModelIndex & index,
int role = Qt::DisplayRole ) const
override

◆ emitReloadRecord

void RecordListModel::emitReloadRecord ( QPersistentModelIndex index)
signal

◆ headerData()

QVariant RecordListModel::headerData ( int section,
Qt::Orientation orientation,
int role ) const
override

◆ killLoaders()

void RecordListModel::killLoaders ( )

◆ recordsChanged

void RecordListModel::recordsChanged ( std::vector< atlas::records::Game > records)
signal

◆ refreshOnFuture()

void RecordListModel::refreshOnFuture ( QPersistentModelIndex index,
QFuture< QPixmap > future )

◆ reloadRecord

void RecordListModel::reloadRecord ( QPersistentModelIndex index)
slot

◆ removeRecord

void RecordListModel::removeRecord ( QPersistentModelIndex index)
slot

◆ rowCount()

int RecordListModel::rowCount ( const QModelIndex & index = QModelIndex()) const
override

◆ setRecords

void RecordListModel::setRecords ( std::vector< atlas::records::Game > records)
slot

Member Data Documentation

◆ loaders

std::unordered_map< int, std::unique_ptr< atlas::images::ImageLoader > > RecordListModel::loaders {}
private

◆ loading_thread

QThread RecordListModel::loading_thread {}
private

◆ m_records

std::vector< atlas::records::Game > RecordListModel::m_records {}
private

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