PDA

View Full Version : How to Send a signal to external program using pushbutton



arunvv
20th May 2008, 20:08
Hi All,

How to Send a signal to external program using pushbutton?

Thanks & Regards,
Arun.

mcosta
21st May 2008, 07:52
How to Send a signal to external program using pushbutton?

What means "signal"?

POSIX signals, Qt signals, ...

lyuts
29th May 2008, 14:17
I think this is the case when one should use DBus (QtDBus in particular)

nrabara
27th April 2009, 13:45
Hi All,

How to Send a signal to external program using pushbutton?

Thanks & Regards,
Arun.

Hi Arun,
Did you find how to send signal to external program using push button?
I have been using similar application in which i need to intimate other hardware onclick on any buttons.

I have used Dbus, I am able call function of other process using dbus but, to know whether the button has clicked or not, I have to continuously poll.

Is there any solution ?

Your suggestion would be highly appreciable.

With Regards,
Nirav Rabara

QbelcorT
27th April 2009, 16:51
Hi,
If you are using QtEmbedded take a look at QCopChannel. It's sort of the same style as QtDBus, without any external libraries.
As far as knowing the state of the button, just setup a state variable, (bool) for example, set it true when the button is pressed and false when the button is pressed again. (toggle). Your external program can keep track of this. Your Qt program just needs to send the event. When your external program receives the event just xor the bool flag. Just be careful if your external program and QT get out of sync.


RecieveEventFromQt()
{
state ^= true;
if (state == true)
button is pressed;
else
button is not pressed;
}

jpn
27th April 2009, 23:29
Inter-Process Communication in Qt