QtMobility Reference Documentation

Contents

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.

         DeviceInfo {
         id: devinfo
             monitorChargerTypeChanges: true
             monitorChargingStateChanges: true
     }

    See also QSystemBatteryInfo.

    Property Documentation

    batteryStatus : BatteryStatus

    Returns the battery charge status.


    chargerType : ChargerType

    Returns the currently used charger type.


    chargingState : ChargingState

    Returns the charging state.


    currentFlow : 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.


    energyMeasurementUnit : EnergyUnit

    Returns the QSystemBatteryInfo::EnergyUnit that the system uses.


    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.


    monitorBatteryStatusChanges() : bool

    Start the connection for the batteryStatusChanged signal.


    monitorChargerTypeChanges : bool

    Start the connection for the chargerTypeChanged signal.


    monitorChargingStateChanges : bool

    Start the connection for the chargingStateChanged signal.


    monitorCurrentFlowChanges : bool

    Start the connection for the currentFlowChanged signal.


    monitorNominalCapacityChanges : bool

    Start the connection for the nominalCapacityChanged signal.


    monitorRemainingCapacityBarsChanges : bool

    Start the connection for the remainingCapacityBarsChanged signal.


    monitorRemainingCapacityChanges : bool

    Start the connection for the remainingCapacityChanged signal.


    monitorRemainingCapacityPercentChanges : bool

    Start the connection for the remainingCapacityPercentChanged signal.


    monitorRemainingChargingTimeChanges : bool

    Start the connection for the remainingChargingTimeChanged signal.


    nominalCapacity : int

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


    remainingCapacity : int

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

    See also QSystemBatteryInfo::EnergyUnit.


    remainingCapacityBars : 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.


    remainingCapacityPercent : int

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


    remainingChargingTime : int

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


    voltage : int

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


    Signal Documentation

    BatteryInfo::batteryStatusChanged ( BatteryInfo::BatteryStatus )

    This signal is emitted when battery status has changed.

    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.

    See also QSystemBatteryInfo::ChargerType.


    BatteryInfo::chargingStateChanged ( BatteryInfo::ChargingState )

    This signal is emitted when charging state has changed.

    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.

    See also QSystemBatteryInfo::currentFlow.


    BatteryInfo::nominalCapacityChanged ( int )

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

    See also QSystemBatteryInfo::nominalCapacity.


    BatteryInfo::remainingCapacityBarsChanged ( int )

    This signal is emitted when battery level has changed.

    See also QSystemBatteryInfo::remainingCapacityBars.


    BatteryInfo::remainingCapacityChanged ( QSystemBatteryInfo::EnergyUnit )

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

    See also QSystemBatteryInfo::remainingCapacity.


    BatteryInfo::remainingCapacityPercentChanged ( int )

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

    See also QSystemBatteryInfo::remainingCapacityPercent.


    BatteryInfo::remainingChargingTimeChanged ( int )

    This signal is emitted when remianing charge time has changed.

    See also QSystemBatteryInfo::remainingChargingTime.