QDeviceInfo Class
The QDeviceInfo class provides various information of the system. More...
Header: | #include <QDeviceInfo> |
Public Types
enum | Feature { BluetoothFeature, CameraFeature, FmRadioFeature, FmTransmitterFeature, InfraredFeature, …, NfcFeature } |
enum | LockType { NoLock, PinLock, TouchOrKeyboardLock, UnknownLock } |
flags | LockTypeFlags |
enum | ThermalState { UnknownThermal, NormalThermal, WarningThermal, AlertThermal, ErrorThermal } |
enum | Version { Os, Firmware } |
Properties
- activatedLocks : const LockTypeFlags
- enabledLocks : const LockTypeFlags
- thermalState : const ThermalState
Public Functions
QDeviceInfo(QObject *parent = Q_NULLPTR) | |
virtual | ~QDeviceInfo() |
QDeviceInfo::LockTypeFlags | activatedLocks() const |
QString | boardName() const |
bool | currentBluetoothPowerState() |
QDeviceInfo::LockTypeFlags | enabledLocks() const |
bool | hasFeature(QDeviceInfo::Feature feature) const |
QString | imei(int interfaceNumber) const |
int | imeiCount() const |
QString | manufacturer() const |
QString | model() const |
QString | operatingSystemName() const |
QString | productName() const |
QDeviceInfo::ThermalState | thermalState() const |
QString | uniqueDeviceID() const |
QString | version(QDeviceInfo::Version type) const |
Signals
void | activatedLocksChanged(QDeviceInfo::LockTypeFlags types) |
void | bluetoothStateChanged(bool on) |
void | enabledLocksChanged(QDeviceInfo::LockTypeFlags types) |
void | thermalStateChanged(QDeviceInfo::ThermalState state) |
Detailed Description
Member Type Documentation
enum QDeviceInfo::Feature
This enum describes the features of the device.
Constant | Value | Description |
---|---|---|
QDeviceInfo::BluetoothFeature | 0 | Bluetooth feature. |
QDeviceInfo::CameraFeature | 1 | Camera feature. |
QDeviceInfo::FmRadioFeature | 2 | Frequency modulation (FM) radio feature. |
QDeviceInfo::FmTransmitterFeature | 3 | Frequency modulation (FM) radio transmitter feature. |
QDeviceInfo::InfraredFeature | 4 | Infrared communication feature. |
QDeviceInfo::LedFeature | 5 | Light-emitting diode (LED) feature. |
QDeviceInfo::MemoryCardFeature | 6 | Memory card feature. |
QDeviceInfo::UsbFeature | 7 | Universal system bus (USB) feature. |
QDeviceInfo::VibrationFeature | 8 | Vibration feature. |
QDeviceInfo::WlanFeature | 9 | Wireless local area network (WLAN) feature. |
QDeviceInfo::SimFeature | 10 | Subscriber identity module (SIM) feature. |
QDeviceInfo::PositioningFeature | 11 | Positioning feature, e.g. Global Positioning System (GPS). |
QDeviceInfo::VideoOutFeature | 12 | Video out feature. |
QDeviceInfo::HapticsFeature | 13 | Haptics feature, the platform can provide audio and/or visual and/or vibration feedback. |
QDeviceInfo::NfcFeature | 14 | Near Field Communication (NFC) feature. |
enum QDeviceInfo::LockType
flags QDeviceInfo::LockTypeFlags
This enum describes lock type on the device.
Constant | Value | Description |
---|---|---|
QDeviceInfo::NoLock | 0 | No lock. |
QDeviceInfo::PinLock | 0x0000001 | Device can be locked by PIN code or password. |
QDeviceInfo::TouchOrKeyboardLock | 0x0000002 | Device can be locked by touch or keyboard. |
QDeviceInfo::UnknownLock | 0x0000004 | lock types requested but no result received yet. |
The LockTypeFlags type is a typedef for QFlags<LockType>. It stores an OR combination of LockType values.
enum QDeviceInfo::ThermalState
This enum describes the thermal state:
Constant | Value | Description |
---|---|---|
QDeviceInfo::UnknownThermal | 0 | The thermal state is unknown. |
QDeviceInfo::NormalThermal | 1 | The thermal state is normal. |
QDeviceInfo::WarningThermal | 2 | The thermal state is warning. |
QDeviceInfo::AlertThermal | 3 | The thermal state is alert. |
QDeviceInfo::ErrorThermal | 4 | The thermal state is error. |
enum QDeviceInfo::Version
This enum describes the version component.
Constant | Value | Description |
---|---|---|
QDeviceInfo::Os | 0 | Operating system version. For Linux, it returns the version of the distribution if any. |
QDeviceInfo::Firmware | 1 | Version of (flashable) system as a whole. For Linux, it's the version of the kernel. |
Property Documentation
activatedLocks : const LockTypeFlags
This property holds the activated lock types.
The current activated lock types of the device. It suggests that these lock types are also enabled.
Access functions:
QDeviceInfo::LockTypeFlags | activatedLocks() const |
Notifier signal:
void | activatedLocksChanged(QDeviceInfo::LockTypeFlags types) |
enabledLocks : const LockTypeFlags
This property holds the enabled lock types.
The current lock types that are enabled on the device. Note that it doesn't mean the device is currently locked.
Access functions:
QDeviceInfo::LockTypeFlags | enabledLocks() const |
Notifier signal:
void | enabledLocksChanged(QDeviceInfo::LockTypeFlags types) |
thermalState : const ThermalState
This property holds the thermal state.
The current thermal state of the device. If there are more than one thermal zone devices available, the state of the most critical one is reported.
Access functions:
QDeviceInfo::ThermalState | thermalState() const |
Notifier signal:
void | thermalStateChanged(QDeviceInfo::ThermalState state) |
Member Function Documentation
QDeviceInfo::QDeviceInfo(QObject *parent = Q_NULLPTR)
Constructs a QDeviceInfo object with the given parent.
[signal]
void QDeviceInfo::activatedLocksChanged(QDeviceInfo::LockTypeFlags types)
This signal is emitted when the activated locks have changed to types.
Note: Notifier signal for property activatedLocks.
[signal]
void QDeviceInfo::enabledLocksChanged(QDeviceInfo::LockTypeFlags types)
This signal is emitted when the enabled locks have changed to types.
Note: Notifier signal for property enabledLocks.
[signal]
void QDeviceInfo::thermalStateChanged(QDeviceInfo::ThermalState state)
This signal is emitted when the thermal state has changed to state.
Note: Notifier signal for property thermalState.
[virtual]
QDeviceInfo::~QDeviceInfo()
Destroys the object
QString QDeviceInfo::boardName() const
Returns the board name for the device, or an empty string if an error or not available.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
bool QDeviceInfo::currentBluetoothPowerState()
Returns the current bluetooth power state.
Note: Getter function for property currentBluetoothPowerState.
bool QDeviceInfo::hasFeature(QDeviceInfo::Feature feature) const
Returns true if the feature is supported, otherwise false.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
QString QDeviceInfo::imei(int interfaceNumber) const
Returns the International Mobile Equipment Identity (IMEI) of the given interfaceNumber on the device. In case of error, or the information is not available, an empty string is returned.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
int QDeviceInfo::imeiCount() const
Returns the count of available International Mobile Equipment Identity (IMEI) of the device. In case of error, or the information is not available, -1 is returned.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
QString QDeviceInfo::manufacturer() const
Returns the name of the manufacturer of this device, or the name of the vendor of the motherboard as a fallback. In case of error, or the information is not available, an empty string is returned.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
QString QDeviceInfo::model() const
Returns the model information of the device, e.g. N8, or the CPU architect as a fallback. In case of error, or the information is not available, an empty string is returned.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
QString QDeviceInfo::operatingSystemName() const
Returns the name for the operating system for the device, or an empty string if an error or not available.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
QString QDeviceInfo::productName() const
Returns the internal product name of the device, e.g. RM-774. In case of error, or the information is not available, an empty string is returned.
For Linux, it returns the codename of the distribution if any.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
QString QDeviceInfo::uniqueDeviceID() const
Returns a unique identifier for the device, or an empty string if on error or not available.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
QString QDeviceInfo::version(QDeviceInfo::Version type) const
Returns the version of type. In case of error, or the version is unknown, an empty string is returned.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.