Michel Feinstein
Michel Feinstein

Reputation: 14296

Wake QThread from Windows event

I wanted to have a sleeping thread that will be waked when a specifc USB device is inserted (VID and PID matches the ones I am expecting). How may I connect QThreads to Windows native notifications and make this work?

Upvotes: 1

Views: 120

Answers (1)

László Papp
László Papp

Reputation: 53195

You can use the QAbstractNativeEventFilter to make a subclass for your Windows event.

As for your thread, you could use QWakeCondition to wait for this event to happen.

Upvotes: 1

Related Questions