Jellyfin Qt
QML Library for interacting with the Jellyfin multimedia server
Loading...
Searching...
No Matches
Jellyfin::ViewModel::ItemModel Class Reference

Base class for each model that works with items. More...

#include <itemmodel.h>

Inheritance diagram for Jellyfin::ViewModel::ItemModel:
Jellyfin::ApiModel< Model::Item > Jellyfin::BaseApiModel

Public Types

enum  RoleNames {
  jellyfinId = Qt::UserRole + 1 , name , originalTitle , serverId ,
  etag , sourceType , playlistItemId , dateCreated ,
  dateLastMediaAdded , extraType , imageTags , imageBlurHashes ,
  mediaType , type , collectionType , indexNumber ,
  runTimeTicks , artists , artistItems , isFolder ,
  overview , parentIndexNumber , userDataRating , userDataPlayedPercentage ,
  userDataUnplayedItemCount , userDataPlaybackPositionTicks , userDataPlayCount , userDataFavorite ,
  userDataLikes , userDataLastPlayedDate , userDataPlayed , userDataKey ,
  currentProgramName , currentProgramOverview , currentProgramStartDate , currentProgramEndDate ,
  jellyfinExtendModelAfterHere = Qt::UserRole + 300
}
 

Public Member Functions

 ItemModel (QObject *parent=nullptr)
 
virtual QHash< int, QByteArray > roleNames () const override
 
QVariant data (const QModelIndex &index, int role) const override
 
QSharedPointer< Model::ItemitemAt (int index)
 
- Public Member Functions inherited from Jellyfin::ApiModel< Model::Item >
 ApiModel (QObject *parent=nullptr)
 Creates a new basemodel.
 
int rowCount (const QModelIndex &index) const override
 
QSharedPointer< Model::Itemat (int index) const
 
int size () const
 
void insert (int index, QSharedPointer< Model::Item > object)
 
void append (QSharedPointer< Model::Item > object)
 
void append (QList< QSharedPointer< Model::Item > > &objects)
 
QList< Model::Item * > mid (int pos, int length=-1)
 
void removeAt (int index)
 
void removeUntilEnd (int from)
 
void removeOne (QSharedPointer< Model::Item > object)
 
void clear () override
 
const QList< QSharedPointer< Model::Item > > & toList ()
 
virtual bool canFetchMore (const QModelIndex &parent) const override
 
virtual void fetchMore (const QModelIndex &parent) override
 
BaseModelLoaderloader () const override
 
void setLoader (BaseModelLoader *newLoader)
 
void reload () override
 
- Public Member Functions inherited from Jellyfin::BaseApiModel
 BaseApiModel (QObject *parent=nullptr)
 
void disconnectOldLoader (BaseModelLoader *oldLoader)
 

Additional Inherited Members

- Public Slots inherited from Jellyfin::BaseApiModel
- Signals inherited from Jellyfin::BaseApiModel
void loaderChanged ()
 
- Protected Slots inherited from Jellyfin::BaseApiModel
- Protected Member Functions inherited from Jellyfin::ApiModel< Model::Item >
void loadingFinished () override
 
- Protected Attributes inherited from Jellyfin::ApiModel< Model::Item >
QList< QSharedPointer< Model::Item > > m_array
 
ModelLoader< Model::Item > * m_loader
 
- Properties inherited from Jellyfin::BaseApiModel
BaseModelLoaderloader
 

Detailed Description

Base class for each model that works with items.

Member Enumeration Documentation

◆ RoleNames

Enumerator
jellyfinId 
name 
originalTitle 
serverId 
etag 
sourceType 
playlistItemId 
dateCreated 
dateLastMediaAdded 
extraType 
imageTags 
imageBlurHashes 
mediaType 
type 
collectionType 
indexNumber 
runTimeTicks 
artists 
artistItems 
isFolder 
overview 
parentIndexNumber 
userDataRating 
userDataPlayedPercentage 
userDataUnplayedItemCount 
userDataPlaybackPositionTicks 
userDataPlayCount 
userDataFavorite 
userDataLikes 
userDataLastPlayedDate 
userDataPlayed 
userDataKey 
currentProgramName 
currentProgramOverview 
currentProgramStartDate 
currentProgramEndDate 
jellyfinExtendModelAfterHere 

Constructor & Destructor Documentation

◆ ItemModel()

Jellyfin::ViewModel::ItemModel::ItemModel ( QObject * parent = nullptr)
explicit

Member Function Documentation

◆ data()

QVariant Jellyfin::ViewModel::ItemModel::data ( const QModelIndex & index,
int role ) const
override

◆ itemAt()

QSharedPointer< Model::Item > Jellyfin::ViewModel::ItemModel::itemAt ( int index)

◆ roleNames()

virtual QHash< int, QByteArray > Jellyfin::ViewModel::ItemModel::roleNames ( ) const
inlineoverridevirtual

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