Provide QUDevMonitorObserver to integrate a Monitor into the Qt event loop in applications using the PySide binding to Qt.
To use this module, PySide.QtCore from PySide must be available.
New in version 0.6.
Observe a Monitor and emit Qt signals upon device events:
>>> context = pyudev.Context()
>>> monitor = pyudev.Monitor.from_netlink(context)
>>> monitor.filter_by(subsystem='input')
>>> observer = pyudev.pyqt4.QUDevMonitorObserver(monitor)
>>> def device_connected(device):
... print('{0!r} added'.format(device))
>>> observer.deviceAdded.connect(device_connected)
>>> monitor.start()
This class is a child of QObject.
Observe the given monitor (a Monitor):
parent is the parent QObject of this object. It is passed unchanged to the inherited constructor of QObject.
Whether this observer is enabled or not.
If True (the default), this observer is enabled, and emits events. Otherwise it is disabled and does not emit any events. This merely reflects the state of the enabled property of the underlying notifier.
New in version 0.14.
Signals
This class defines the following Qt signals:
Emitted upon any device event. action is a unicode string containing the action name, and device is the Device object describing the device.
Basically the arguments of this signal are simply the return value of receive_device()