QUsbInfo Class

This class handles hotplug and device detection. More...

Header: #include <QUsbInfo>
qmake: QT += usb
Inherits: QObject

Note: All functions in this class are reentrant.

Properties

Public Functions

virtual ~QUsbInfo()
int findDevice(const QUsbDevice::Id &id, const QUsbDevice::IdList &list) const
bool isPresent(const QUsbDevice::Id &id) const
QUsbDevice::LogLevel logLevel() const
void setLogLevel(QUsbDevice::LogLevel level)

Public Slots

bool addDevice(const QUsbDevice::Id &id)
bool removeDevice(const QUsbDevice::Id &id)

Static Public Members

QUsbDevice::IdList devices()

Protected Slots

void checkDevices()
void monitorDevices(const QUsbDevice::IdList &list)

Detailed Description

Handles USB events and searching. Can be used to monitor events for a list of devices or all system devices.

See also QUsbDevice.

Property Documentation

logLevel : QUsbDevice::LogLevel

This property holds the log level for hotplug/detection.

Access functions:

QUsbDevice::LogLevel logLevel() const
void setLogLevel(QUsbDevice::LogLevel level)

Member Function Documentation

[slot] bool QUsbInfo::addDevice(const QUsbDevice::Id &id)

Add an id device to the list.

Returns false if device was already in the list, else true.

[protected slot] void QUsbInfo::checkDevices()

Check devices present in system.

This gets called by the internal timer.

[protected slot] void QUsbInfo::monitorDevices(const QUsbDevice::IdList &list)

Add a list to monitor.

[slot] bool QUsbInfo::removeDevice(const QUsbDevice::Id &id)

Remove id device from the list.

Return bool false if device was not in the list, else true.

[virtual] QUsbInfo::~QUsbInfo()

Unregister callbacks and close the usb context.

[static] QUsbDevice::IdList QUsbInfo::devices()

Returns all present devices.

int QUsbInfo::findDevice(const QUsbDevice::Id &id, const QUsbDevice::IdList &list) const

Search an id device in a device list.

Return index of the filter, returns -1 if not found.

bool QUsbInfo::isPresent(const QUsbDevice::Id &id) const

Check if id device is present.

Return bool true if present.

QUsbDevice::LogLevel QUsbInfo::logLevel() const

Get current log level.

Note: Getter function for property logLevel.

See also setLogLevel().

void QUsbInfo::setLogLevel(QUsbDevice::LogLevel level)

Set log level (only hotplug/detection).

Note: Setter function for property logLevel.

See also logLevel().