views:

235

answers:

2

I want to create an event in one Qt application that can be picked up by a seperate Qt application running at the same time. The normal sendevent function requires you to name the object which will receive it but I can't use that, I want it to be like a keyboard press event which filters through any open programs in the OS. Does anyone know how to do that? thanks

A: 

First of all - it'd be far from cross platform and cannot use Qt for this specific function. So, so answer that question, which OS are you aiming for?

Second, are you writing both applications? Why not pass your "events" through D-bus (UNIX only...), or even over XMLRPC (http://doc.libqxt.org/tip/qxtrpcservice.html), and avoid the whole faking event business?

e8johan
thanks. Yes I'm writing both and I'm using kubuntu. The reason I was wanting to use events was because I was just trying to simulate how the program will run once it's running on its target
Mark
+1  A: 

Take a look at Inter-Process Communication in Qt. The most cross-platform friendly way is to use a socket.

Shared memory is also an option, but for events I would recommend a socket that you can then attach slots to on the receiving side to handle it like a local event.

Edit: Sorry I think i missed the real point when I read the other answer, you want to make something like a key-logger that records strokes anywhere. Not sure about that one.

Adam W