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  · 

QML BatteryInfo Element

The BatteryInfo element allows you to receive battery change notifications from the device. More...

  • List of all members, including inherited members
  • Properties

    Signals

    Detailed Description

    This element is part of the QtMobility.systeminfo 1.2 module. It is a convience class to make QML usage easier.

    Note: To use notification signals, you need to set the monitor* properties to true.

     BatteryInfo {
         id: batinfo
             monitorChargerTypeChanges: true
             monitorChargingStateChanges: true
     }

    See also QSystemBatteryInfo.

    Property Documentation

    read-onlybatteryStatus : BatteryStatus

    Returns the battery charge status.

    This documentation was introduced in Qt Mobility Mobility 1.2.


    read-onlychargerType : ChargerType

    Returns the currently used charger type.

    This documentation was introduced in Qt Mobility Mobility 1.2.


    read-onlychargingState : ChargingState

    Returns the charging state.

    This documentation was introduced in Qt Mobility Mobility 1.2.


    read-onlycurrentFlow : int

    Returns the amount of current flowing out from the battery (a short term averge), milliapmeres (mA). Positive current means discharging and negative current means charging.

    This documentation was introduced in Qt Mobility Mobility 1.2.


    read-onlyenergyMeasurementUnit : EnergyUnit

    Returns the QSystemBatteryInfo::EnergyUnit that the system uses.

    This documentation was introduced in Qt Mobility Mobility 1.2.


    maxBars : int

    Returns the Maximum number of bars the system uses. In the case that the system has no default number of battery bars, 0 is returned.

    This documentation was introduced in Qt Mobility Mobility 1.2.


    read-onlymonitorBatteryStatusChanges() : bool

    Start the connection for the batteryStatusChanged signal.

    This documentation was introduced in Qt Mobility Mobility 1.2.


    read-onlymonitorChargerTypeChanges : bool

    Start the connection for the chargerTypeChanged signal.

    This documentation was introduced in Qt Mobility Mobility 1.2.


    read-onlymonitorChargingStateChanges : bool

    Start the connection for the chargingStateChanged signal.

    This documentation was introduced in Qt Mobility Mobility 1.2.


    read-onlymonitorCurrentFlowChanges : bool

    Start the connection for the currentFlowChanged signal.

    This documentation was introduced in Qt Mobility Mobility 1.2.


    read-onlymonitorNominalCapacityChanges : bool

    Start the connection for the nominalCapacityChanged signal.

    This documentation was introduced in Qt Mobility Mobility 1.2.


    read-onlymonitorRemainingCapacityBarsChanges : bool

    Start the connection for the remainingCapacityBarsChanged signal.

    This documentation was introduced in Qt Mobility Mobility 1.2.


    read-onlymonitorRemainingCapacityChanges : bool

    Start the connection for the remainingCapacityChanged signal.

    This documentation was introduced in Qt Mobility Mobility 1.2.


    read-onlymonitorRemainingCapacityPercentChanges : bool

    Start the connection for the remainingCapacityPercentChanged signal.

    This documentation was introduced in Qt Mobility Mobility 1.2.


    read-onlymonitorRemainingChargingTimeChanges : bool

    Start the connection for the remainingChargingTimeChanged signal.

    This documentation was introduced in Qt Mobility Mobility 1.2.


    read-onlynominalCapacity : int

    Returns the nominal (maximum) capacity of the battery, in milliampere-hours (mAh). If no battery is found, -1.

    This documentation was introduced in Qt Mobility Mobility 1.2.


    read-onlyremainingCapacity : int

    Returns the remaining battery level of the battery in BatteryInfo::EnergyUnit.

    This documentation was introduced in Qt Mobility Mobility 1.2.

    See also QSystemBatteryInfo::EnergyUnit.


    read-onlyremainingCapacityBars : int

    Returns the remaining capacity in number of bars. The bar count will not necessarily always reflect one to one on the remaining capacity percentage.

    This documentation was introduced in Qt Mobility Mobility 1.2.


    read-onlyremainingCapacityPercent : int

    Returns the remaining battery level of the battery in percent. If no battery is found, -1.

    This documentation was introduced in Qt Mobility Mobility 1.2.


    read-onlyremainingChargingTime : int

    Returns the remaining time of charging in seconds if charging, 0 if battery is full and not charging, or -1 no battery found.

    This documentation was introduced in Qt Mobility Mobility 1.2.


    read-onlyvoltage : int

    Returns the voltage of the battery, in millivolts (mV). If no battery is found, -1.

    This documentation was introduced in Qt Mobility Mobility 1.2.


    Signal Documentation

    BatteryInfo::batteryStatusChanged ( BatteryInfo::BatteryStatus )

    This signal is emitted when battery status has changed.

    This documentation was introduced in Qt Mobility Mobility 1.2.

    See also QSystemBatteryInfo::ChargingState.


    BatteryInfo::chargerTypeChanged ( BatteryInfo::ChargerType )

    This signal is emitted when the charger type has changed, such as when a phone gets plugged in to the wall, or usb.

    This documentation was introduced in Qt Mobility Mobility 1.2.

    See also QSystemBatteryInfo::ChargerType.


    BatteryInfo::chargingStateChanged ( BatteryInfo::ChargingState )

    This signal is emitted when charging state has changed.

    This documentation was introduced in Qt Mobility Mobility 1.2.

    See also QSystemBatteryInfo::ChargingState.


    BatteryInfo::currentFlowChanged ( int )

    This signal is emitted when the short term averge battery current has changed, or on some systems at regular intervals.

    On some systems where this can lead to a CPU intensive process, you should disconnect from this signal when you are finished.

    This documentation was introduced in Qt Mobility Mobility 1.2.

    See also QSystemBatteryInfo::currentFlow.


    BatteryInfo::nominalCapacityChanged ( int )

    This signal is emitted when nominal (maximum) battery level has changed.

    This documentation was introduced in Qt Mobility Mobility 1.2.

    See also QSystemBatteryInfo::nominalCapacity.


    BatteryInfo::remainingCapacityBarsChanged ( int )

    This signal is emitted when battery level has changed.

    This documentation was introduced in Qt Mobility Mobility 1.2.

    See also QSystemBatteryInfo::remainingCapacityBars.


    BatteryInfo::remainingCapacityChanged ( QSystemBatteryInfo::EnergyUnit )

    This signal is emitted when battery capacity has changed, reported in QSystemBatteryInfo::EnergyUnit.

    This documentation was introduced in Qt Mobility Mobility 1.2.

    See also QSystemBatteryInfo::remainingCapacity.


    BatteryInfo::remainingCapacityPercentChanged ( int )

    This signal is emitted when battery capacity in percent has changed.

    This documentation was introduced in Qt Mobility Mobility 1.2.

    See also QSystemBatteryInfo::remainingCapacityPercent.


    BatteryInfo::remainingChargingTimeChanged ( int )

    This signal is emitted when remianing charge time has changed.

    This documentation was introduced in Qt Mobility Mobility 1.2.

    See also QSystemBatteryInfo::remainingChargingTime.


    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

    Combiner licence, à propos et fermer d'une autre manière

    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.2
    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