[Interest] Native event filter in QtService

Julius Bullinger Julius.Bullinger at asctec.de
Fri Jun 24 09:25:11 CEST 2016


I'm trying to write a small (windows only) service based on QtService [1] listening for some USB device events. For this, I created a NativeDeviceEventFilter class based on QAbstractNativeEventFilter. It works perfectly when used in a QCoreApplication.

Now, when installing this event filter in my UpdaterService class, it isn't being called.

I tried each of:


  application()->installNativeEventFilter(deviceEvent_);



  QCoreApplication::instance()->installNativeEventFilter(deviceEvent_);



  QAbstractEventDispatcher::instance()->installNativeEventFilter(deviceEvent_);

both in the service's constructor and start() method, as well as using a local instance of NativeDeviceEventFilter,
but none of these worked. The event just isn't registered at all.

Has anyone ever done something like this? Or is there another way to receive native messages (MSG structs) in a QtService?

Best regards,
Julius

[1]: https://github.com/qtproject/qt-solutions/tree/master/qtservice
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160624/2d4dfaf6/attachment.html>


More information about the Interest mailing list