首页| 论坛| 消息

标题:获取进程id
作者:buptzhw
日期:2010-07-07 13:49
内容:

我用QProcess调用外部程序,请问我该如何获得这个外部程序的进程id,


#1 [xtfllbl 07-08 16:51]
process->pid();
#2 回 1楼(xtfllbl) 的帖子 [buptzhw 07-09 09:33]
请问怎么在一个lineEdit显示这个值呢?能把代码都写上来吗?
我是新手,怎么都不会了
#3 回 2楼(buptzhw) 的帖子 [xtfllbl 07-09 13:30]
typedef Q_PID
Typedef for the identifiers used to represent processes on the underlying platform. On Unix and Symbian, this corresponds to qint64; on Windows, it corresponds to _PROCESS_INFORMATION*.
取出来pid是int,转换成qstring就是了,比如
 QStirng a=QString::number(process->pid);
 lineEdit->setText(a);
#4 回 3楼(xtfllbl) 的帖子 [buptzhw 07-12 15:52]
感谢

回复 发表
主题 版块