Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions |
The QHardwareManager class finds available hardware abstraction providers for a given interface. More...
#include <QHardwareManager>
Inherits QAbstractIpcInterfaceGroupManager.
The QHardwareManager class finds available hardware abstraction providers for a given interface.
QHardwareManager is part of the Qt Extended Hardware Abstraction, which provides information about the available hardware devices.
A QHardwareMonitor can be used to monitor the availability of a given type of hardware, providing a list of providers through providers() and emitting signals providerAdded() and providerRemoved() when that list changes. The type of hardware monitored is given as a parameter to constructing the QHardwareMonitor.
The following example responds whenever a new QSignalSource becomes available:
QHardwareManager* manager = new QHardwareManager( "QSignalSource" ); connect( manager, SIGNAL(providerAdded(QString)), this, SLOT(newBatteryAdded(QString)));
The types of a hardware abstraction is the name of the abstraction classes which implement the interface to the device. Any class that is subclassing QHardwareInterface is considered to be a Qt Extended hardware abstraction.
See also QHardwareInterface, QPowerSource, QSignalSource, and QVibrateAccessory.
Creates a QHardwareManager object and attaches it to parent. interface is the name of the hardware interface that this object is monitoring.
The following code assumes that Qt Extended is running on a device that has a modem as power source (for more details see QPowerStatus and QPowerSource).
QHardwareManager manager( "QPowerSource" ); QStringList providers = manager.providers(); //Qt Extended always has a virtual power source with id DefaultBattery providers.contains( "DefaultBattery" ); //always true providers.contains( "modem" ); //true
Another way to achieve the same as the above example would be:
QStringList providers = QHardwareManager::providers<QPowerSource>(); providers.contains( "DefaultBattery" ); //always true providers.contains( "modem" ); //true
Destroys the QHardwareManager object.
Returns the interface that this object is monitoring.
This signal is emitted when provider id is added.
This signal is emitted when provider id is removed.
Returns a list of providers that support the interface that this object was initialized with.
This is an overloaded member function, provided for convenience.
Returns a list of providers which support the given interface of type T. The following example demonstrates how to get the list of providers that supports the QPowerSource interface.
QStringList providers = QHardwareManager::providers<QPowerSource>();
Copyright © 2009 Nokia | Trademarks | Qt Extended 4.4.3 |