Sayonara Player
|
The ItemModel is intended to abstract the various views. It supports searching, selections and a library. More...
#include <ItemModel.h>
Public Types | |
using | ExtraTriggerMap = QMap<QChar, QString> |
Public Member Functions | |
ItemModel (int columnCount, QObject *parent, AbstractLibrary *library) | |
QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override |
bool | setHeaderData (int section, Qt::Orientation orientation, const QVariant &value, int role=Qt::EditRole) override |
int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
QModelIndexList | searchResults (const QString &substr) override |
virtual int | searchableColumn () const =0 |
the index of the searchable column. This is the column where the text is searched for a certain searchstring | |
virtual QString | searchableString (int row) const =0 |
here, the searchable string can even be refined. Maybe we just want to search within a substring indicated by the row | |
virtual Id | mapIndexToId (int row) const =0 |
return the current id for a given row | |
virtual Cover::Location | cover (const QModelIndexList &indexList) const =0 |
return the cover for multiple rows. if rows.size() > 1, an invalid, default constructed cover location is usually shown | |
virtual const MetaDataList & | selectedMetadata () const =0 |
return the tracks which belong to the selections. If an album is selected for example, all tracks of that album should be returned | |
virtual QMimeData * | mimeData (const QModelIndexList &indexList) const override |
void | refreshData (int *rowCountBefore=nullptr, int *rowCountAfter=nullptr) |
virtual ExtraTriggerMap | getExtraTriggers () |
virtual::Library::SearchModeMask | searchMode () const final |
Protected Member Functions | |
AbstractLibrary * | library () |
const AbstractLibrary * | library () const |
The ItemModel is intended to abstract the various views. It supports searching, selections and a library.
|
pure virtual |
return the cover for multiple rows. if rows.size() > 1, an invalid, default constructed cover location is usually shown
rows |
Implemented in Library::CoverModel, Library::AlbumModel, Library::ArtistModel, and Library::TrackModel.
|
pure virtual |
return the current id for a given row
row |
Implemented in Library::CoverModel, Library::AlbumModel, Library::ArtistModel, and Library::TrackModel.
|
pure virtual |
the index of the searchable column. This is the column where the text is searched for a certain searchstring
Implemented in Library::CoverModel, Library::AlbumModel, Library::ArtistModel, and Library::TrackModel.
|
pure virtual |
here, the searchable string can even be refined. Maybe we just want to search within a substring indicated by the row
row |
Implemented in Library::CoverModel, Library::AlbumModel, Library::ArtistModel, and Library::TrackModel.
|
overridevirtual |
Implements SearchableModelInterface.
|
pure virtual |
return the tracks which belong to the selections. If an album is selected for example, all tracks of that album should be returned
Implemented in Library::CoverModel, Library::AlbumModel, Library::ArtistModel, and Library::TrackModel.