Qt: can't launch Windows console with QProcess

蓝咒 提交于 2019-12-07 08:58:35

问题


QProcess simply doesn't display the black console window.

This is the code I use:

QProcess*p=new QProcess(this);
p->start("cmd.exe");

Replacing cmd.exe with calc.exe successfully launches the calculator.


回答1:


Try this instead:

QProcess::startDetached("cmd.exe");


来源:https://stackoverflow.com/questions/10363918/qt-cant-launch-windows-console-with-qprocess

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!