Results 1 to 5 of 5

Thread: How to get the Process ID of my QApplication ?

  1. #1
    Join Date
    Sep 2008
    Posts
    23
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default How to get the Process ID of my QApplication ?

    Hi,

    does anyone know how to determine the PID of a QApplication from within the application itself ? I've been searching for a while now and I didn't find a solution...

    Frank

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to get the Process ID of my QApplication ?

    I guess that will be platform dependant.... look into the system api's of the os u are using..

  3. #3
    Join Date
    Sep 2008
    Posts
    23
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Red face Re: How to get the Process ID of my QApplication ?

    Well, my application supports 3 platforms (Linux, Win, Mac), so a platform independant solution would be very helpful...
    There are so many OS-functions available, but this seems to be a gap
    I just wonder why class QProcess provides such a pid()-function...
    However, thanks for your reply !

  4. #4
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to get the Process ID of my QApplication ?

    Found this - QCoreApplication::applicationPid ()
    hope it helps

  5. #5
    Join Date
    Sep 2008
    Posts
    23
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to get the Process ID of my QApplication ?

    Great, that's what I've been looking for ! Thanks !
    I checked documentation of QCoreApplication multiple times but I didn't see it...

Similar Threads

  1. Process Read/Write
    By QbelcorT in forum Newbie
    Replies: 0
    Last Post: 20th November 2008, 03:08
  2. QApplication instance
    By nile.one in forum Qt Programming
    Replies: 9
    Last Post: 5th October 2007, 12:06
  3. how can I get the QApplication handle by process ID in QT2
    By pencilren in forum Qt Programming
    Replies: 5
    Last Post: 28th August 2007, 20:10
  4. Replies: 2
    Last Post: 16th March 2007, 09:04
  5. How to activate another process?
    By gtthang in forum Qt Programming
    Replies: 6
    Last Post: 3rd February 2006, 07:53

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.