• 5371阅读
  • 4回复

获取进程id [复制链接]

上一主题 下一主题
离线buptzhw
 
只看楼主 倒序阅读 楼主  发表于: 2010-07-07
我用QProcess调用外部程序,请问我该如何获得这个外部程序的进程id,
离线xtfllbl

只看该作者 1楼 发表于: 2010-07-08
process->pid();
上海欢迎您
离线buptzhw
只看该作者 2楼 发表于: 2010-07-09
回 1楼(xtfllbl) 的帖子
请问怎么在一个lineEdit显示这个值呢?能把代码都写上来吗?
我是新手,怎么都不会了
离线xtfllbl

只看该作者 3楼 发表于: 2010-07-09
回 2楼(buptzhw) 的帖子
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就是了,比如
  1.  QStirng a=QString::number(process->pid);
  2.  lineEdit->setText(a);

上海欢迎您
离线buptzhw
只看该作者 4楼 发表于: 2010-07-12
回 3楼(xtfllbl) 的帖子
感谢
快速回复
限100 字节
 
上一个 下一个