Skip to content

QDeviceWatcher not working on Windows #17

@DonaldDuck313

Description

@DonaldDuck313

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions