Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

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

  • QFavoriteServicesModel ( QObject * parent = 0 )
  • virtual QVariant data ( const QModelIndex & index, int role = Qt::DisplayRole ) const
  • QtopiaServiceDescription description ( const QModelIndex & index ) const
  • QModelIndex indexOf ( const QtopiaServiceDescription & desc ) const
  • bool insert ( const QModelIndex & index, const QtopiaServiceDescription & desc )
  • bool move ( const QModelIndex & from, const QModelIndex & to )
  • bool remove ( const QModelIndex & index )
  • virtual int rowCount ( const QModelIndex & parent = QModelIndex() ) const
  • QString speedDialInput ( const QModelIndex & index ) const

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.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 64
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. La rubrique Qt a besoin de vous ! 1
Page suivante

Le Qt Quarterly au hasard

Logo

Abusons de QMap

Qt Quarterly est la revue trimestrielle proposée par Nokia et à destination des développeurs Qt. Ces articles d'une grande qualité technique sont rédigés par des experts Qt. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt qtextended4.4
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web