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

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.

ConstantValueDescription
QDeviceInfo::BluetoothFeature0Bluetooth feature.
QDeviceInfo::CameraFeature1Camera feature.
QDeviceInfo::FmRadioFeature2Frequency modulation (FM) radio feature.
QDeviceInfo::FmTransmitterFeature3Frequency modulation (FM) radio transmitter feature.
QDeviceInfo::InfraredFeature4Infrared communication feature.
QDeviceInfo::LedFeature5Light-emitting diode (LED) feature.
QDeviceInfo::MemoryCardFeature6Memory card feature.
QDeviceInfo::UsbFeature7Universal system bus (USB) feature.
QDeviceInfo::VibrationFeature8Vibration feature.
QDeviceInfo::WlanFeature9Wireless local area network (WLAN) feature.
QDeviceInfo::SimFeature10Subscriber identity module (SIM) feature.
QDeviceInfo::PositioningFeature11Positioning feature, e.g. Global Positioning System (GPS).
QDeviceInfo::VideoOutFeature12Video out feature.
QDeviceInfo::HapticsFeature13Haptics feature, the platform can provide audio and/or visual and/or vibration feedback.
QDeviceInfo::NfcFeature14Near Field Communication (NFC) feature.

enum QDeviceInfo::LockType
flags QDeviceInfo::LockTypeFlags

This enum describes lock type on the device.

ConstantValueDescription
QDeviceInfo::NoLock0No lock.
QDeviceInfo::PinLock0x0000001Device can be locked by PIN code or password.
QDeviceInfo::TouchOrKeyboardLock0x0000002Device can be locked by touch or keyboard.
QDeviceInfo::UnknownLock0x0000004lock 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:

ConstantValueDescription
QDeviceInfo::UnknownThermal0The thermal state is unknown.
QDeviceInfo::NormalThermal1The thermal state is normal.
QDeviceInfo::WarningThermal2The thermal state is warning.
QDeviceInfo::AlertThermal3The thermal state is alert.
QDeviceInfo::ErrorThermal4The thermal state is error.

enum QDeviceInfo::Version

This enum describes the version component.

ConstantValueDescription
QDeviceInfo::Os0Operating system version. For Linux, it returns the version of the distribution if any.
QDeviceInfo::Firmware1Version 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.