PDA

View Full Version : How to get the Process ID of my QApplication ?



Comer352l
28th November 2008, 17:35
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

aamer4yu
28th November 2008, 18:02
I guess that will be platform dependant.... look into the system api's of the os u are using..

Comer352l
28th November 2008, 20:12
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 :o
I just wonder why class QProcess provides such a pid()-function...
However, thanks for your reply !

aamer4yu
28th November 2008, 20:20
Found this - QCoreApplication::applicationPid ()

hope it helps :)

Comer352l
29th November 2008, 11:11
Great, that's what I've been looking for ! Thanks !
I checked documentation of QCoreApplication multiple times but I didn't see it...:o:o:o