Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

QFavoriteServicesModel Class Reference
[QtBaseModule]

The QFavoriteServicesModel class provides a data model of the Favorite Services list. More...

    #include <QFavoriteServicesModel>

Inherits QAbstractListModel.

This class was introduced in Qtopia 4.4.

Public Types

Public Functions

Additional Inherited Members


Detailed Description

The QFavoriteServicesModel class provides a data model of the Favorite Services list.

This model provides functions for accessing and manipulating the favorite services list. If you merely need to add or remove a service, use the FavoritesService service.

The Qt Extended favorite services list is a list of service requests which have been selected by the user. The list can be reordered by the user, and items can have an optional Speed dial number associated with them. List items are unique, each distinct service description will only appear once.

The favorites list designed to contain services which the user would wish to quickly access. The favorites list will be easily accessible and easily manipulated by the user. This is similar to the concept of bookmarks in a web browser.

Note that any optional properties in the service description are not considered when determining whether two descriptions are distinct.

See also FavoritesService and QSpeedDial.


Member Type Documentation

enum QFavoriteServicesModel::QFavoriteServicesModelRole

Extends Qt::ItemDataRole

ConstantValueDescription
QFavoriteServicesModel::SpeedDialInputRoleQt::UserRoleA string containing the speed dial input associated with this favorite, if any.


Member Function Documentation

QFavoriteServicesModel::QFavoriteServicesModel ( QObject * parent = 0 )

Constructs a QFavoriteServicesModel with the given parent.

QFavoriteServicesModel::~QFavoriteServicesModel ()

Destroys the model.

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

Returns the data stored under the given role for the item referred to by the index. The display role contains the service description's label, and the decoration role contains the service desription's icon (as a QIcon). The other roles used are defined in QFavoriteServicesModelRole.

Reimplemented from QAbstractItemModel.

QtopiaServiceDescription QFavoriteServicesModel::description ( const QModelIndex & index ) const

Returns the QtopiaServiceDescription of the item at index.

QModelIndex QFavoriteServicesModel::indexOf ( const QtopiaServiceDescription & desc ) const

Returns the index of the entry with the QtopiaServiceDescription desc. Otherwise returns an invalid QModelIndex.

bool QFavoriteServicesModel::insert ( const QModelIndex & index, const QtopiaServiceDescription & desc )

Adds the given QtopiaServiceDescription, desc, to the Favorite Services list. It will be placed above the item at index. If index is invalid it will place it at the end of the list, behaving the same as FavoritesService::add. If the service description desc already exists in the list, it will be moved from its current position to the position above the item at index. Returns true if it successfully inserts or moves the specified service description, false otherwise.

See also FavoritesService::add().

bool QFavoriteServicesModel::move ( const QModelIndex & from, const QModelIndex & to )

Changes the order of the Favorite Service entries by moving the entry at index from to index to. This will also change the row of entries between these rows, but not their relative position. Returns true if the move is successful, false otherwise.

bool QFavoriteServicesModel::remove ( const QModelIndex & index )

Removes the action currently at the given index. Returns true if successful, false otherwise.

See also FavoritesService::remove().

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

Returns the number of rows in the model, which is independent of the parent.

Reimplemented from QAbstractItemModel.

QString QFavoriteServicesModel::speedDialInput ( const QModelIndex & index ) const

Returns the speed dial input for the item at index if it has one. Otherwise returns a null string.


Copyright © 2009 Trolltech Trademarks
Qt Extended 4.4.3