Results 1 to 4 of 4

Thread: QT console application and CTRL+C

  1. #1
    Join Date
    Mar 2011
    Location
    PL
    Posts
    11
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QT console application and CTRL+C

    Hello,
    I'm writing qt server application and I need functions to handle SIGINT and SIGTERM signals. I've found functions watchUnixSignal() and unixSignal() which are members of QCoreApplication, but they are not described in the QT documentation. Do anyone know, why?

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QT console application and CTRL+C

    If its not documented, it means its not meant to be used, and that it can change or get deleted in any future release.
    Have a look at this to help you with your problem:
    http://doc.qt.nokia.com/4.7/unix-signals.html
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Mar 2011
    Location
    PL
    Posts
    11
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QT console application and CTRL+C

    I've found this manual about unix signals, but i need something, what will be able to handle signals in windows. Any ideas?
    Last edited by dawwin; 18th March 2011 at 00:11.

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QT console application and CTRL+C

    you can use the signal() function and give it your signal handler:
    http://msdn.microsoft.com/en-us/libr...=vs.71%29.aspx
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. about console application
    By jirach_gag in forum Qt Programming
    Replies: 2
    Last Post: 5th January 2012, 11:39
  2. Replies: 2
    Last Post: 21st November 2010, 18:03
  3. Debugging a console application
    By Lorthirk in forum Qt Tools
    Replies: 1
    Last Post: 26th September 2009, 11:49
  4. How to catch CTRL+Y in application
    By Morea in forum Qt Programming
    Replies: 1
    Last Post: 29th April 2009, 06:14
  5. unable to run Console application
    By jay in forum Qt Programming
    Replies: 4
    Last Post: 12th June 2008, 07:33

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.