Home · All Classes · Grouped Classes · Annotated · Functions

QContentSetModel Class Reference

    #include <QContentSetModel>

Inherits QAbstractListModel.

Public Functions

Additional Inherited Members


Detailed Description

QAbstractItemModel subclass

The QContentSetModel provides a model to represent the data in a QContentSet.


Member Function Documentation

QContentSetModel::QContentSetModel ( const QContentSet * cls, QObject * parent = 0 )

Construct a new model based on the QContentSet cls with parent parent.

QContentSetModel::~QContentSetModel ()   [virtual]

Destroys a QContentSetModel object.

QContent QContentSetModel::content ( uint row ) const

Returns the QContent for the requested row.

QContent QContentSetModel::content ( const QModelIndex & index ) const

This is an overloaded member function, provided for convenience.

Returns the QContent for the requested index.

QContentId QContentSetModel::contentId ( uint row ) const

Returns the QContentId for the requested row. The value returned may be QContent::InvalidId if the QContent has not been committed to the backing store, or there is no associated QContentSet for the model.

QContentId QContentSetModel::contentId ( const QModelIndex & index ) const

This is an overloaded member function, provided for convenience.

Returns the QContentId for the requested index.

QVariant QContentSetModel::data ( const QModelIndex & index, int role = Qt::DisplayRole ) const   [virtual]

Return the appropriate QVariant data from the model for the given index. Depending upon the role, the QVariant will contain the name of the QContent object at that index, its icon, or relevant tooltip text. The "ToolTip" text is shown when the user hovers the cursor over the item in the model view. The tooltip text will display the comment() field from the QContent object, or if error() is true, the error text. Additionally the drm rights in summary form will be shown.

Reimplemented from QAbstractItemModel.

QDrmRights::Permissions QContentSetModel::mandatoryPermissions () const

Returns the permissions a QContent must have in order to be selectable in the content model.

See also QDrmRights and setMandatoryPermissions().

int QContentSetModel::rowCount ( const QModelIndex & parent = QModelIndex() ) const   [virtual]

Return the number of rows in the model - since this is a flat list the parent argument will always be the default null index, indicating a top level item. The result is the count of the items in the backing store which match the filter expression plus any explicitly added non-matching items.

Reimplemented from QAbstractItemModel.

QDrmRights::Permission QContentSetModel::selectPermission () const

Returns the permssion which indicates the intended usage of the content in the model.

See also QDrmRights and setSelectPermission().

void QContentSetModel::setMandatoryPermissions ( QDrmRights::Permissions permissions )

Sets the permissions a QContent must have to in order to be selectable in the content model.

If a row in the model doesn't have all the mandatory permissions the Qt::ItemIsEnabled and Qt::ItemIsSelectable flags will be cleared.

See also QDrmRights and mandatoryPermissions().

void QContentSetModel::setSelectPermission ( QDrmRights::Permission permission )

Sets the permission which indicates the intended usage of the content in the model. Content in the model which doesn't have the selected permission will be displayed with an invalid rights icon.

If the permission is QDrmRights::InvalidPermission the default permission for the content is used.

See also QDrmRights and selectPermission().


Copyright © 2007 Trolltech Trademarks
Qtopia 4.2.5