3#include <QtCore/QEvent>
4#include <QtCore/QObject>
7 class DeviceWatcherPrivate;
104 QString
device()
const {
return m_device; }
111 static Type EventType =
static_cast<Type
>(registerEventType());
bool isRunning() const
Checks whether the watcher is currently monitoring for device changes.
DeviceWatcher(QObject *parent=0)
Constructs a DeviceWatcher with the given parent object.
void deviceAdded(const QString &dev)
Emitted when a new device is added to the system.
void appendEventReceiver(QObject *receiver)
Appends an additional event receiver that will be notified of device change events.
bool start()
Starts watching for device changes.
void deviceChanged(const QString &dev)
Emitted when a device state changes, such as when unmounting.
static DeviceWatcher & DefaultWatcher()
Returns the singleton default DeviceWatcher instance.
bool running
Whether the watcher is currently active.
bool stop()
Stops watching for device changes.
DeviceWatcherPrivate * d_ptr
Private implementation pointer for platform-specific watching logic.
void deviceRemoved(const QString &dev)
Emitted when a device is removed from the system.
Action
Enumerates the possible device change actions.
@ Remove
A device was removed.
@ Change
A device state changed (e.g., unmounting).
static Type registeredType()
Returns the registered QEvent type for device change events.
QString device() const
Returns the device identifier associated with this event.
Action action() const
Returns the action type of this device change event.
QDeviceChangeEvent(Action action, const QString &device)
Constructs a device change event with the given action and device identifier.
The primary namespace for the NDEVR SDK.