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  · 

QSystemDeviceInfo Class Reference

The QSystemDeviceInfo class provides access to device information from the system. More...

    #include <QSystemDeviceInfo>

Inherits QObject.


Public Types

enum BatteryStatus { NoBatteryLevel, BatteryCritical, BatteryVeryLow, BatteryLow, BatteryNormal }
enum InputMethod { Keys, Keypad, Keyboard, SingleTouch, MultiTouch, Mouse }
flags InputMethodFlags
enum PowerState { UnknownPower, BatteryPower, WallPower, WallPowerChargingBattery }
enum Profile { UnknownProfile, SilentProfile, NormalProfile, LoudProfile, ..., CustomProfile }
enum SimStatus { SimNotAvailable, SingleSimAvailable, DualSimAvailable, SimLocked }

Properties

  • 1 property inherited from QObject

Public Functions

QSystemDeviceInfo ( QObject * parent = 0 )
virtual ~QSystemDeviceInfo ()
int batteryLevel () const
QSystemDeviceInfo::BatteryStatus batteryStatus ()
QSystemDeviceInfo::PowerState currentPowerState ()
QSystemDeviceInfo::Profile currentProfile ()
QSystemDeviceInfo::InputMethodFlags inputMethodType ()
bool isDeviceLocked ()
QSystemDeviceInfo::SimStatus simStatus ()
  • 29 public functions inherited from QObject

Signals

void batteryLevelChanged ( int level )
void batteryStatusChanged ( QSystemDeviceInfo::BatteryStatus status )
void bluetoothStateChanged ( bool on )
void currentProfileChanged ( QSystemDeviceInfo::Profile profile )
void powerStateChanged ( QSystemDeviceInfo::PowerState state )

Static Public Members

QString imei ()
QString imsi ()
QString manufacturer ()
QString model ()
QString productName ()
  • 4 static public members inherited from QObject

Additional Inherited Members

  • 1 public slot inherited from QObject
  • 1 public type inherited from QObject
  • 7 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

The QSystemDeviceInfo class provides access to device information from the system.


Member Type Documentation

enum QSystemDeviceInfo::BatteryStatus

This enum describes the status of the main battery.

ConstantValueDescription
QSystemDeviceInfo::NoBatteryLevel0Battery level undetermined.
QSystemDeviceInfo::BatteryCritical1Battery level is critical 3% or less.
QSystemDeviceInfo::BatteryVeryLow2Battery level is very low, 10% or less.
QSystemDeviceInfo::BatteryLow3Battery level is low 40% or less.
QSystemDeviceInfo::BatteryNormal4Battery level is above 40%.

enum QSystemDeviceInfo::InputMethod
flags QSystemDeviceInfo::InputMethodFlags

This enum describes the device method of user input.

ConstantValueDescription
QSystemDeviceInfo::Keys0x0000001Device has key/buttons.
QSystemDeviceInfo::Keypad0x0000002Device has keypad (1,2,3, etc).
QSystemDeviceInfo::Keyboard0x0000004Device has qwerty keyboard.
QSystemDeviceInfo::SingleTouch0x0000008Device has single touch screen.
QSystemDeviceInfo::MultiTouch0x0000010Device has muti touch screen.
QSystemDeviceInfo::Mouse0x0000020Device has a mouse.

The InputMethodFlags type is a typedef for QFlags<InputMethod>. It stores an OR combination of InputMethod values.

enum QSystemDeviceInfo::PowerState

This enum describes the power state:

ConstantValueDescription
QSystemDeviceInfo::UnknownPower0Power error.
QSystemDeviceInfo::BatteryPower1On battery power.
QSystemDeviceInfo::WallPower2On wall power.
QSystemDeviceInfo::WallPowerChargingBattery3On wall power and charging main battery.

enum QSystemDeviceInfo::Profile

This enum describes the current operating profile of the device or computer.

ConstantValueDescription
QSystemDeviceInfo::UnknownProfile0Profile unknown or error.
QSystemDeviceInfo::SilentProfile1Silent profile.
QSystemDeviceInfo::NormalProfile2Normal profile.
QSystemDeviceInfo::LoudProfile3Loud profile.
QSystemDeviceInfo::VibProfile4Vibrate profile.
QSystemDeviceInfo::OfflineProfile5Offline profile.
QSystemDeviceInfo::PowersaveProfile6Powersave profile.
QSystemDeviceInfo::CustomProfile7Custom profile.

enum QSystemDeviceInfo::SimStatus

This enum describes the status is the sim card or cards.

ConstantValueDescription
QSystemDeviceInfo::SimNotAvailable0SIM is not available on this device.
QSystemDeviceInfo::SingleSimAvailable1One SIM card is available on this.
QSystemDeviceInfo::DualSimAvailable2Two SIM cards are available on this device.
QSystemDeviceInfo::SimLocked3Device has SIM lock enabled.


Property Documentation

batteryLevel : const int

This property holds the battery level.

Returns the battery charge level as percentage 1 - 100 scale.

Access functions:

int batteryLevel () const

batteryStatus : const BatteryStatus

This property holds the battery status.

Returns the battery charge status.

Access functions:

QSystemDeviceInfo::BatteryStatus batteryStatus ()

currentPowerState : const PowerState

This property holds the power state.

Gets the current QSystemDeviceInfo::currentPowerState state.

Access functions:

QSystemDeviceInfo::PowerState currentPowerState ()

currentProfile : const Profile

This property holds the device profile Gets the current QSystemDeviceInfo::currentProfile device profile.

Access functions:

QSystemDeviceInfo::Profile currentProfile ()

imei : const QString

This property holds the IMEI.

Returns the International Mobile Equipment Identity (IMEI), or a null QString in the case of none.

Access functions:

QString imei ()

imsi : const QString

This property holds the IMSI.

Returns the International Mobile Subscriber Identity (IMSI), or a null QString in the case of none.

Access functions:

QString imsi ()

inputMethodType : const InputMethodFlags

This property holds the supported inputmethods.

Returns the QSystemDeviceInfo::InputMethodFlags InputMethodType that the system uses.

Access functions:

QSystemDeviceInfo::InputMethodFlags inputMethodType ()

isDeviceLocked : const bool

This property holds device lock.

Returns true if the device is locked, otherwise false.

Access functions:

bool isDeviceLocked ()

manufacturer : const QString

This property holds the manufacture's name.

Returns the name of the manufacturer of this device. In the case of desktops, the name of the vendor of the motherboard.

Access functions:

QString manufacturer ()

model : const QString

This property holds the model name.

Returns the model information of the device. In the case of desktops where no model information is present, the CPU architect, such as i686, and machine type, such as Server, Desktop or Laptop.

Access functions:

QString model ()

productName : const QString

This property holds the product name.

Returns the product name of the device. In the case where no product information is available,

Access functions:

QString productName ()

simStatus : const SimStatus

This property holds the status of the sim card. Returns the QSystemDeviceInfo::simStatus status of SIM card.

Access functions:

QSystemDeviceInfo::SimStatus simStatus ()

Member Function Documentation

QSystemDeviceInfo::QSystemDeviceInfo ( QObject * parent = 0 )

Constructs a QSystemDeviceInfo with the given parent.

QSystemDeviceInfo::~QSystemDeviceInfo ()   [virtual]

Destroys the QSystemDeviceInfo object.

void QSystemDeviceInfo::batteryLevelChanged ( int level )   [signal]

This signal is emitted when battery level has changed. level is the new level.

void QSystemDeviceInfo::batteryStatusChanged ( QSystemDeviceInfo::BatteryStatus status )   [signal]

This signal is emitted when battery status has changed. status is the new status.

void QSystemDeviceInfo::bluetoothStateChanged ( bool on )   [signal]

This signal is emitted whenever bluetooth state changes, specified by on.

void QSystemDeviceInfo::currentProfileChanged ( QSystemDeviceInfo::Profile profile )   [signal]

This signal is emitted whenever the network profile changes, specified by profile.

void QSystemDeviceInfo::powerStateChanged ( QSystemDeviceInfo::PowerState state )   [signal]

This signal is emitted when the power state has changed, such as when a phone gets plugged qint32o the wall. state is the new power state.

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 94
  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. Pourquoi les programmeurs sont-ils moins payés que les gestionnaires de programmes ? Manquent-ils de pouvoir de négociation ? 48
  4. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  5. Les développeurs détestent-ils les antivirus ? Un programmeur manifeste sa haine envers ces solutions de sécurité 13
  6. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  7. Qt Commercial : Digia organise un webinar gratuit le 27 mars sur la conception d'interfaces utilisateur et d'applications avec le framework 0
Page suivante

Le Qt Developer Network au hasard

Logo

Génération de bindings PySide avec Shiboken

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 qtmobility-1.0-tp
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