QSignalSource Class Reference
|
key | Decription |
---|---|
SignalSources/DefaultSignalSource | Name (ID) of the QSignalSource to use as the default signal source. |
If the default signal source is not explicitly configured via the configuration file above a modem signal source is preferred over a WLAN signal source. If there are several signal sources of the same type the first signal source that is created will be used. If the default signal source is configured, but the specified provider does not exist, then QSignalSource becomes invalid. The default signal is provided by the DefaultSignal server task.
A specific QSignalSource can be selected as shown in the following example:
QSignalSource* src = 0; QHardwareManager* manager = new QHardwareManager("QSignalSource", this); QStringList providers = man->providers(); //find a WLAN signal source foreach( QString signalSourceId, providers ) { src = new QSignalSource( signalSourceId, this ); if ( src->type() == "wlan" ) { break; } else { delete src; src = 0; } } if ( !src ) { //could not find signal source for WLAN //fall back to virtual default signal source src = new QSignalSource( "DefaultSignal", this ); if ( src->availability() == QSignalSource::Invalid ) { //no signal source available at all } }
New signal sources can be added to Qt Extended via the QSignalSourceProvider class.
See also QSignalSourceProvider, QHardwareManager, and DefaultSignal.
Represents whether the signal source is available.
Constant | Value | Description |
---|---|---|
QSignalSource::Available | 0 | The signal source is available. |
QSignalSource::NotAvailable | 1 | The Signal source is not available. If the signal source is of type "wlan" the signal strength is temporarily not available while the WLAN interface is not connected. |
QSignalSource::Invalid | 2 | The signal source is not valid. This is distinct from the not available case. A reason for this state could be that QSignalSource was initialised with an invalid/not existing ID or in the case of the default signal source there simply is no signal source available that the default signal source could map to. |
Constructs a new signal source for provider id with the specified parent.
If id is empty, this class will use the default signal source.
Destroys the QSignalSource.
Returns the signal source availability.
This signal is emitted whenever the availability of the signal source changes; availability is the new value.
Returns the signal source strength as a percentage of the maximum strength, or -1 if the strength is unavailable or invalid.
This signal is emitted whenever the strength of the signal changes; signalStrength is the new value.
Returns the type of the signal source, e.g. "wlan", "modem", or an empty string if this signal source is invalid.
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 ! |
Copyright © 2000-2012 - www.developpez.com