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

#include <FilepathModel.hpp>

Inheritance diagram for FilepathModel:

Public Types

enum  CustomRoles { StartUserRole = Qt::UserRole , PixmapRole , FilepathRole }
 

Public Slots

void setFilepaths (const std::vector< std::filesystem::path > &filepaths)
 
void reloadRecord (QPersistentModelIndex index)
 

Signals

void reordered ()
 

Public Member Functions

 FilepathModel (QObject *parent=nullptr)
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const override
 
QModelIndex parent (const QModelIndex &child) const override
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 
Qt::DropActions supportedDropActions () const override
 
bool insertRows (int row, int col, const QModelIndex &parent=QModelIndex()) override
 
bool removeRows (int row, int count, const QModelIndex &parent=QModelIndex()) override
 
bool moveRows (const QModelIndex &sourceParent, int sourceRow, int count, const QModelIndex &destinationParent, int destinationChild) override
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 
std::vector< std::filesystem::path > getFilepaths () const
 
void refreshOnFuture (QPersistentModelIndex index, QFuture< QPixmap > future)
 
void killLoaders ()
 

Private Attributes

std::vector< std::filesystem::path > m_paths {}
 
std::unordered_map< int, std::unique_ptr< atlas::images::ImageLoader > > loaders {}
 
QThread loading_thread {}
 

Member Enumeration Documentation

◆ CustomRoles

Enumerator
StartUserRole 
PixmapRole 
FilepathRole 

Constructor & Destructor Documentation

◆ FilepathModel()

FilepathModel::FilepathModel ( QObject * parent = nullptr)

Member Function Documentation

◆ data()

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

◆ flags()

Qt::ItemFlags FilepathModel::flags ( const QModelIndex & index) const
override

◆ getFilepaths()

std::vector< std::filesystem::path > FilepathModel::getFilepaths ( ) const

◆ index()

QModelIndex FilepathModel::index ( int row,
int column,
const QModelIndex & parent = QModelIndex() ) const
override

◆ insertRows()

bool FilepathModel::insertRows ( int row,
int col,
const QModelIndex & parent = QModelIndex() )
override

◆ killLoaders()

void FilepathModel::killLoaders ( )

◆ moveRows()

bool FilepathModel::moveRows ( const QModelIndex & sourceParent,
int sourceRow,
int count,
const QModelIndex & destinationParent,
int destinationChild )
override

◆ parent()

QModelIndex FilepathModel::parent ( const QModelIndex & child) const
override

◆ refreshOnFuture()

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

◆ reloadRecord

void FilepathModel::reloadRecord ( QPersistentModelIndex index)
slot

◆ removeRows()

bool FilepathModel::removeRows ( int row,
int count,
const QModelIndex & parent = QModelIndex() )
override

◆ reordered

void FilepathModel::reordered ( )
signal

◆ rowCount()

int FilepathModel::rowCount ( const QModelIndex & parent = QModelIndex()) const
override

◆ setData()

bool FilepathModel::setData ( const QModelIndex & index,
const QVariant & value,
int role = Qt::EditRole )
override

◆ setFilepaths

void FilepathModel::setFilepaths ( const std::vector< std::filesystem::path > & filepaths)
slot

◆ supportedDropActions()

Qt::DropActions FilepathModel::supportedDropActions ( ) const
override

Member Data Documentation

◆ loaders

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

◆ loading_thread

QThread FilepathModel::loading_thread {}
private

◆ m_paths

std::vector< std::filesystem::path > FilepathModel::m_paths {}
private

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