Re: [Development] [Interest] Native event filter in QtService

2016-06-24 Thread André Somers



Op 24/06/2016 om 11:18 schreef Bo Thorsen:

Hi all,

I'm copying this to devel, because it fits in a discussion a week or 
two ago.


Den 24-06-2016 kl. 10:56 skrev Tony Rietwyk:

qtservice_win.cpp around line 830 at your reference [1] installs its own
nativeEventFilter - probably displacing yours.

I suspect you'll need to merge the Qt filter into yours, and get rid of
that install.


That is impossible for commercial projects because the solutions are 
LGPL only. You can't copy LGPL code into your own code base unless you 
are using GPL or LGPL yourself.


And that's why I copied this message to devel, because there was a 
discussion on whether to add solutions to Qt Core or not. And one of 
the arguments against is that people can just use the solutions as 
they are. This is one case, where apparently that's not (at least 
currently) possible.


I can come up with a couple of workarounds for this, sure. But these 
are all brittle and may not work if the solutions code is changed.
In a previous company I worked for, we simply created an LGPL lib for 
all the stuff we borrowed this way. I really don't see why one can't use 
an LGPL-ed lib for most situations.


André
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] [Interest] Native event filter in QtService

2016-06-24 Thread Bo Thorsen

Hi all,

I'm copying this to devel, because it fits in a discussion a week or two 
ago.


Den 24-06-2016 kl. 10:56 skrev Tony Rietwyk:

qtservice_win.cpp around line 830 at your reference [1] installs its own
nativeEventFilter - probably displacing yours.

I suspect you'll need to merge the Qt filter into yours, and get rid of
that install.


That is impossible for commercial projects because the solutions are 
LGPL only. You can't copy LGPL code into your own code base unless you 
are using GPL or LGPL yourself.


And that's why I copied this message to devel, because there was a 
discussion on whether to add solutions to Qt Core or not. And one of the 
arguments against is that people can just use the solutions as they are. 
This is one case, where apparently that's not (at least currently) possible.


I can come up with a couple of workarounds for this, sure. But these are 
all brittle and may not work if the solutions code is changed.



*From:*Interest
[mailto:interest-bounces+tony=rightsoft.com...@qt-project.org] *On
Behalf Of *Julius Bullinger
*Sent:* Friday, 24 June 2016 5:25 PM
*To:* inter...@qt-project.org Interest
*Subject:* [Interest] Native event filter in QtService

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
NativeDeviceEventFilterclass based on QAbstractNativeEventFilter. It
works perfectly when used in a QCoreApplication.

Now, when installing this event filter in my UpdaterServiceclass, 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?


Bo Thorsen,
Director, Viking Software.

--
Viking Software
Qt and C++ developers for hire
http://www.vikingsoft.eu
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development