Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QDeviceWatcher not working on Windows #17

Open
DonaldDuck313 opened this issue Oct 24, 2021 · 1 comment
Open

QDeviceWatcher not working on Windows #17

DonaldDuck313 opened this issue Oct 24, 2021 · 1 comment

Comments

@DonaldDuck313
Copy link

I tried using the following simple code on Windows to detect when devices are inserted or removed:

QDeviceWatcher deviceWatcher;
QObject::connect(&deviceWatcher, &QDeviceWatcher::deviceAdded, [](){
    qDebug() << "Device added";
});
QObject::connect(&deviceWatcher, &QDeviceWatcher::deviceChanged, [](){
    qDebug() << "Device changed";
});
QObject::connect(&deviceWatcher, &QDeviceWatcher::deviceRemoved, [](){
    qDebug() << "Device removed";
});

I tried inserting/removing several USB devices while this program was running, but none of these signals were ever emitted. The USB devices that I tried were a USB mouse and an Android phone with a USB cable.

@DougRogers
Copy link

Did you at the HotplugWatcher example?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants