Use qApp to get application pid.