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  · 

QDeviceIndicatorsProvider Class Reference
[QtBaseModule]

The QDeviceIndicatorsProvider class provides the backend for the QDeviceIndicator API. More...

    #include <QDeviceIndicatorsProvider>

Inherits QObject.

Public Functions

  • 29 public functions inherited from QObject

Protected Functions

  • 7 protected functions inherited from QObject

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 1 signal inherited from QObject
  • 1 public type inherited from QObject
  • 4 static public members inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

The QDeviceIndicatorsProvider class provides the backend for the QDeviceIndicator API.

QDeviceIndicatorsProvider derived types control the status of device indicators. During construction, derived types usually call addSupportedIndicator() followed by setIndicatorSupportedStates() to set up the indicators they provide. Derived classes must implement the changeIndicatorState() and changeIndicatorAttribute() functions which perform the actual hardware operations involved.

Communication between the frontend QDeviceIndicators and backend QDeviceIndicatorsProvider is facilitated through the Qt Extended Value Space. Whenever the state or attributes of an indicator are modified, the status of the indicators should be reflected in the Value Space via setIndicatorState() and setIndicatorAttribute().

The following table shows a few common attributes and how they could be represented.

Attributetype(units)
Period (Flash state)int (ms)
Duty Cycle(Flash state)int (%)
TransitionTime (Throb state)int (ms)
ColorQColor

Because the indicator names and supported states and attributes are device specific, it is expected that the implementer of the QDeviceIndicatorsProvider derived class will provide these to the user of QDeviceIndicators. If the possible values a particular attribute need to be queryable, then another attribute can be made specifically for this eg a SupportedColors attribute whose type is QList<QColor>. Generally this would not be necessary since the possible supported values should be provided to the user of QDeviceIndicators.

This class is part of the Qt Extended server and a specific implementation should be provided as part of a server task.

See also QDeviceIndicators.


Member Function Documentation

QDeviceIndicatorsProvider::QDeviceIndicatorsProvider ( QObject * parent = 0 )

Create a new QDeviceIndicatorsProvider instance with the specified parent.

void QDeviceIndicatorsProvider::addSupportedIndicator ( const QString & indicator )   [protected]

Add an indicator that this QDeviceIndicatorsProvider instance will provide. changeIndicatorState() callbacks will only occur for indicators added in this way or with setSupportedIndicators(). This function will have no effect and produce a warning if an indicator already exists that is already being provided by this or another provider.

The initial state of the indicator is QDeviceIndicators::Off.

See also setSupportedIndicators().

void QDeviceIndicatorsProvider::changeIndicatorAttribute ( const QString & indicator, const QString & attribute, const QVariant & value )   [pure virtual protected]

Called when the attribute of indicator should be set to a new value. This is usually in response to a QDeviceIndicators::setIndicatorAttribute() call. Subclasses should implement the hardware specific operations from this function.

See also changeIndicatorState().

void QDeviceIndicatorsProvider::changeIndicatorState ( const QString & indicator, QDeviceIndicators::IndicatorState state )   [pure virtual protected]

Called when the indicator should be set to state. This is usually in response to a QDeviceIndicators::setIndicatorState() call. Subclasses should implement the hardware specific operations from this function.

See also changeIndicatorAttribute().

void QDeviceIndicatorsProvider::setIndicatorAttribute ( const QString & indicator, const QString & attribute, const QVariant & value )   [protected]

Sets the published attribute of indicator to value. This is generally called during the changeIndicatorAttribute() callback to reflect the successful change in attribute or at startup to publish the attribute's initial value, but it can be called at any time.

This function has no effect if indicator has not previously been added or set.

See also setIndicatorState().

void QDeviceIndicatorsProvider::setIndicatorState ( const QString & indicator, QDeviceIndicators::IndicatorState state )   [protected]

Set the published indicator state to state. This is generally called during the changeIndicatorState() callback to indicate that the state was successfully changed or at startup to set the initial state, but it can be called at any time.

This function has no effect if indicator has not previously been set up.

See also setIndicatorAttribute().

void QDeviceIndicatorsProvider::setIndicatorSupportedStates ( const QString & indicator, QList<QDeviceIndicators::IndicatorState> states )   [protected]

Sets the published list of the supported states of indicator to states.

This function has no effect if indicator has not previously been set up.

See also setIndicatorState().

void QDeviceIndicatorsProvider::setSupportedIndicators ( const QStringList & indicators )   [protected]

Set the indicators that this QDeviceIndicatorsProvider instance will provide. changeIndicatorState() callbacks will only occur for indicators set in this way or added with addSupportedIndicator(). If an indicator in the in the indicators list is already provided by another QDeviceIndicators instance, then that indicator is not set and a warning is produced.

The initial state of the indicators is QDeviceIndicators::Off.

See also addSupportedIndicator().

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 Developer Network au hasard

Logo

Introduction

Le Qt Developer Network est un réseau de développeurs Qt anglophone, où ils peuvent partager leur expérience sur le framework. 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