c – QProcess :: start和QProcess :: startDetached之间有什么区别?

c – QProcess :: start和QProcess :: startDetached之间有什么区别?,第1张

概述Qt文档给出了这样的解释: > QProcess :: start: Starts the given program in a new process, if none is already running, passing the command line arguments in arguments. > QProcess :: startDetached: Starts the progr Qt文档给出了这样的解释:

> QProcess :: start:

Starts the given program in a new process,if none is already running,
passing the command line arguments in arguments.

> QProcess :: startDetached:

Starts the program program with the arguments arguments in a new
process,and detaches from it.

两者有什么区别?区别的只是你可以使用QProcess :: start和使用QProcess :: startDetached的许多实例只启动一个程序实例吗?

解决方法 如果使用start,则调用者进程的终止也将导致被调用进程的终止.如果您使用startDetached,则在终止呼叫者后,该孩子将继续生活.例如:
QProcess * p = new QProcess();p->start("some-app");delete p;// <---some-app will be terminatedQProcess * p = new QProcess();p->startDetached("some-app");delete p;// <---some-app will continue to live
总结

以上是内存溢出为你收集整理的c – QProcess :: start和QProcess :: startDetached之间有什么区别?全部内容,希望文章能够帮你解决c – QProcess :: start和QProcess :: startDetached之间有什么区别?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1236882.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-06
下一篇 2022-06-06

发表评论

登录后才能评论

评论列表(0条)

保存