QSoundCloud
A Qt/C++ library and QML module to access the SoundCloud Data API.
 All Classes Functions Enumerations Properties Groups Pages
Public Slots | Signals | Public Member Functions | Properties | List of all members
QSoundCloud::Model Class Reference

The base class for data models providing representations of SoundCloud Data API resources. More...

Inheritance diagram for QSoundCloud::Model:
QSoundCloud::ResourcesModel QSoundCloud::StreamsModel

Public Slots

void clear ()
 Removes all items.

Signals

void countChanged (int c)
 Emitted when items are added/removed.

Public Member Functions

int rowCount (const QModelIndex &parent=QModelIndex()) const
 Returns the number of items in the model.
QVariant data (const QModelIndex &index, int role) const
 Re-implemented from QAbstractListModel::data()
QMap< int, QVariant > itemData (const QModelIndex &index) const
 Re-implemented from QAbstractListModel::itemData()
bool setData (const QModelIndex &index, const QVariant &value, int role)
 Re-implemented from QAbstractListModel::setData()
bool setItemData (const QModelIndex &index, const QMap< int, QVariant > &roles)
 Re-implemented from QAbstractListModel::setItemData()
void append (const QMap< int, QVariant > &roles)
 Appends an item using the data in roles.
void insert (const QModelIndex &index, const QMap< int, QVariant > &roles)
 Inserts an item before index using the data in roles.
bool remove (const QModelIndex &index)
 Removes the item at index.
Q_INVOKABLE QVariantMap get (int row) const
 Returns the item at row.
Q_INVOKABLE bool setProperty (int row, const QString &property, const QVariant &value)
 Sets the property of the item at row to value.
Q_INVOKABLE bool set (int row, const QVariantMap &properties)
 Sets the properties of the item at row to properties.
Q_INVOKABLE void append (const QVariantMap &properties)
 Appends an item to the model using properties.
Q_INVOKABLE void insert (int row, const QVariantMap &properties)
 Inserts an item before row to the model using properties.
Q_INVOKABLE bool remove (int row)
 Removes the item at row.

Properties

int count
 The number of items in the model.

Detailed Description

The base class for data models providing representations of SoundCloud Data API resources.

Normally, you should not need to use this class.

Member Function Documentation

void QSoundCloud::Model::insert ( const QModelIndex &  index,
const QMap< int, QVariant > &  roles 
)

Inserts an item before index using the data in roles.

The item is appended if index is invalid.

void QSoundCloud::Model::insert ( int  row,
const QVariantMap &  properties 
)

Inserts an item before row to the model using properties.

If row is out of range, the item is appended.

bool QSoundCloud::Model::remove ( const QModelIndex &  index)

Removes the item at index.

Returns true if succesful.

bool QSoundCloud::Model::remove ( int  row)

Removes the item at row.

Returns true if successful.

bool QSoundCloud::Model::set ( int  row,
const QVariantMap &  properties 
)

Sets the properties of the item at row to properties.

Returns true if successful.

bool QSoundCloud::Model::setProperty ( int  row,
const QString &  property,
const QVariant &  value 
)

Sets the property of the item at row to value.

Returns true if successful.