47 d->event_receivers.append(receiver);
52 if (!QMetaObject::invokeMethod(
watcher,
"deviceAdded", Q_ARG(QString, dev)))
53 qWarning(
"invoke deviceAdded failed");
55 QMetaObject::invokeMethod(
watcher,
"deviceChanged", Q_ARG(
bool,
true));
60 if (!QMetaObject::invokeMethod(
watcher,
"deviceChanged", Q_ARG(QString, dev)))
61 qWarning(
"invoke deviceChanged failed");
66 if (!QMetaObject::invokeMethod(
watcher,
"deviceRemoved", Q_ARG(QString, dev)))
67 qWarning(
"invoke deviceRemoved failed");
69 QMetaObject::invokeMethod(
watcher,
"deviceChanged", Q_ARG(
bool,
false));
74 QString a(action.toLower());
75 if (a == QLatin1String(
"add"))
77 else if (a == QLatin1String(
"remove"))
79 else if (a == QLatin1String(
"change"))
84 QEvent(registeredType())
void emitDeviceAdded(const QString &dev)
The class of the device watcher.
QDeviceWatcher(QObject *parent=nullptr)
void emitDeviceChanged(const QString &dev)
void emitDeviceAction(const QString &dev, const QString &action)
QDeviceWatcherPrivate * d_ptr
void appendEventReceiver(QObject *receiver)
void emitDeviceRemoved(const QString &dev)
The class of the device watcher private.
QDeviceChangeEvent(Action action, const QString &device)