Results 1 to 6 of 6

Thread: How to Send a signal to external program using pushbutton

  1. #1
    Join Date
    Jun 2006
    Location
    San Diego, USA
    Posts
    95
    Thanks
    9
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default How to Send a signal to external program using pushbutton

    Hi All,

    How to Send a signal to external program using pushbutton?

    Thanks & Regards,
    Arun.

  2. #2
    Join Date
    Jan 2006
    Location
    Napoli, Italy
    Posts
    621
    Thanks
    5
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to Send a signal to external program using pushbutton

    Quote Originally Posted by arunvv View Post
    How to Send a signal to external program using pushbutton?
    What means "signal"?

    POSIX signals, Qt signals, ...
    A camel can go 14 days without drink,
    I can't!!!

  3. #3
    Join Date
    May 2008
    Location
    Kyiv, Ukraine
    Posts
    418
    Thanks
    1
    Thanked 29 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to Send a signal to external program using pushbutton

    I think this is the case when one should use DBus (QtDBus in particular)
    I'm a rebel in the S.D.G.

  4. #4
    Join Date
    Sep 2008
    Posts
    58
    Thanks
    11
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default Re: How to Send a signal to external program using pushbutton

    Quote Originally Posted by arunvv View Post
    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

  5. #5
    Join Date
    Jul 2008
    Posts
    139
    Thanks
    9
    Thanked 18 Times in 15 Posts
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default Re: How to Send a signal to external program using pushbutton

    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.
    Qt Code:
    1. RecieveEventFromQt()
    2. {
    3. state ^= true;
    4. if (state == true)
    5. button is pressed;
    6. else
    7. button is not pressed;
    8. }
    To copy to clipboard, switch view to plain text mode 

  6. #6
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: How to Send a signal to external program using pushbutton

    J-P Nurmi

Similar Threads

  1. Replies: 16
    Last Post: 23rd May 2008, 10:12
  2. Replies: 19
    Last Post: 21st January 2008, 09:13
  3. QT MySQL
    By sabeeshcs in forum Newbie
    Replies: 6
    Last Post: 12th January 2007, 04:19
  4. Link Errors
    By magikalpnoi in forum Qt Programming
    Replies: 5
    Last Post: 25th September 2006, 22:04

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.