Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions |
The QMediaList class provides a filtered list of media content. More...
#include <QMediaList>
Inherits QAbstractListModel.
The QMediaList class provides a filtered list of media content.
The QMediaList class is useful for displaying media content filtered by Artist, Album, Genre etc. For example to display a list of music by artist name containing "Billy".
mediaPlaylist = QMediaList(); itemview->setModel( mediaPlaylist ); mediaPlaylist.clearFilter(); mediaPlaylist.setDisplayRole(QMediaList::Title); mediaPlaylist.beginFilter(); mediaList.setFilter(QMediaList::MimeType,"audio"); mediaList.addFilter(QMediaList::Artist, "Billy"); mediaList.randomize(); mediaList.endFilter();
Constant | Value | Description |
---|---|---|
QMediaList::ShowAll | 0 | Display All entries. |
QMediaList::ShowGrouped | 1 | Display a unique list. |
Constant | Value | Description |
---|---|---|
QMediaList::ShowEmpty | 0 | Display empty field when no data is available. |
QMediaList::ShowEmptyAsUnknown | 1 | Display Unknown when empty field. |
QMediaList::HideEmpty | 2 | Do not display if field has no data. |
Constant | Value | Description |
---|---|---|
QMediaList::Title | 0x01 | Title of media |
QMediaList::Url | 0x02 | Filename, http address |
QMediaList::Artist | 0x04 | Artist of media |
QMediaList::Album | 0x08 | Album of media |
QMediaList::Genre | 0x10 | Genre of media |
QMediaList::MimeType | 0x40 | MimeType of media |
Constant | Value | Description |
---|---|---|
QMediaList::Ascending | 0 | Ascending order sorting. |
QMediaList::Descending | 1 | Descending order sorting. |
QMediaList::Unsorted | 2 | No sorting. |
Constructs a list from the Document System.
Constructs a QMediaList from a QMediaPlaylist playlist.
Constructs a copy of the other QMediaList.
Appends new filter on Category filterType containing string text
eg. addFilter(QMediaList::Title,"Billy");
Returns false on error.
Set filter mode to create, filter will not be applied until endFilter() is called.
Resets current filter.
Returns whether to display all, or to aggregate the data type set by setDisplayRole()
Returns the media lists default display role
See also setDisplayRole() and Qt::DisplayRole.
Applies current filter to data.
Returns true if filters are in effect on the model.
Constructs a QMediaPlaylist from the selected index, or if index is empty, then from the whole QMediaList.
Randomizes the filtered list.
Applies current filters to data and refresh content of list.
Removes filter on Category filterType
eg. removeFilter(QMediaList::Album);
Returns false on error.
Set what role is currently begin displayed. Setting the grouping changes the display from unique to all.
Options for role are: QMediaPlaylist::DataRole
eg. setDisplayRole(QMediaPlaylist::Title, QMediaList::ShowAll);
See also displayRole().
Resets current filter, applying new filter on Category filterType containing string text
eg. setFilter(QMediaList::MimeType,"audio");
Returns false on error.
Sets the given model to be used as the data provider for the list to playlist
Sorts the list by sortType
This is an overloaded member function, provided for convenience.
Sorts the list by sortType, using sort order roles
Set role to handle empty data field.
Options for role are: QMediaList::Properties
eg. showEmpty(QMediaList::HideEmpty);
Assigns the specified medialist to this object.
Returns true if this QMediaList and the other are equal; otherwise returns false.
Copyright © 2009 Nokia | Trademarks | Qt Extended 4.4.3 |