Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions |
The QPowerStatus class provides a simplified interface to the device's primary power sources. More...
#include <QPowerStatus>
Inherits QObject.
The QPowerStatus class provides a simplified interface to the device's primary power sources.
Applications may use the QPowerStatus class to obtain a simplified view of the system's power status. A more complete view can be obtained by examining the supported QPowerSource providers.
Each device may contain two primary power sources - a primary wall power source and a primary battery power source. Both sources are optional, and a specific device may have one, both or neither.
The primary power source sources are selected from the list of available QPowerSource providers. The selection may be configured in the Trolltech/HardwareAccessories configuration file in the following way:
Key | Description |
---|---|
PowerSources/PrimaryWallSource | Name of the QPowerSource to use as the primary wall source. |
PowerSources/PrimaryBatterySource | Name of the QPowerSource to use as the primary battery source. |
If the primary wall source is not configured, the PrimaryAC QPowerSource name is tried first, and, if not available, the first AC source is used. If the primary wall source is configured, but the specified provider does not exist, then no QPowerSource is used.
If the primary battery source is not configured, the DefaultBattery QPowerSource is tried first, and, if not available, the first battery source is used. If the primary battery source is configured, but the specified provider does not exist, then no QPowerSource is used.
The battery status level is determined by mapping a battery percentage to one the four defined levels. The configuration for the various battery status levels are also defined in the Trolltech/HardwareAccessories configuration file in the following way:
Key | Description |
---|---|
PrimaryBattery/NormalStatus | If the battery charge is above this percentage level, it is considered Normal. The default is 30. |
PrimaryBattery/LowStatus | If the battery charge is above this percentage level, but below the normal status level, it is considered Low. The default is 15. |
PrimaryBattery/VeryLowStatus | If the battery charge is above this percentage level, but below the low status level, it is considered very Low. The default is 5. |
If any one of these values is specified illegally (for example, the NormalStatus is lower than the LowStatus), the default values are used.
See also QPowerSource.
Describes the status of the device's battery connection.
Constant | Value | Description |
---|---|---|
QPowerStatus::Normal | 0 | The battery level is within normal operational range. |
QPowerStatus::Low | 1 | The battery is low. |
QPowerStatus::VeryLow | 2 | The battery is very low. |
QPowerStatus::Critical | 3 | The battery is at a critical level. The device should shut down to preserve data. |
QPowerStatus::NoBattery | 4 | There is no battery in the device. |
Describes the status of the device's wall connection.
Constant | Value | Description |
---|---|---|
QPowerStatus::Available | 0 | The device is connected to a wall power supply. |
QPowerStatus::NotAvailable | 1 | The device is not connected to a wall power supply, but connection is supported. |
QPowerStatus::NoWallSource | 2 | The device is not connected to a wall power supply, and no such connection is supported. |
Construct a new QPowerStatus instance with the specified parent.
Destroy the QPowerStatus instance.
Returns true if the primary battery is charging, false if not. If there is no primary battery, false is returned.
This signal is emitted when the batteries charging flag changes.
See also QPowerStatus::batteryCharging().
Returns a pointer to the QPowerSource instance representing the primary battery power source, or null if there is no primary battery power source.
Returns the status of the primary battery power source, or NoBattery if there is no primary battery source.
This signal is emitted whenever the battery status changes.
See also QPowerStatus::batteryStatus().
Returns a pointer to the QPowerSource instance representing the primary wall power source, or null if there is no primary wall power source.
Return the status of the primary wall power source, or NoWallSource if there is no primary wall power source.
This signal is emitted whenever the wall status changes.
See also QPowerStatus::wallStatus().
Copyright © 2009 Trolltech | Trademarks | Qt Extended 4.4.3 |