简体   繁体   English

在Qt应用程序中向用户打开并显示Windows命令提示符

[英]Open and show windows command prompt to user inside Qt application

How would I go about opening the windows command prompt, then sending a command to it and showing it to the user inside my Qt application? 我将如何打开Windows命令提示符,然后向其发送命令并将其显示给我的Qt应用程序内的用户?

I know you can send commands to the command prompt and get output behind the scenes without showing the command prompt to the user, but I want the user to be able to interact with the command prompt window and send their own commands. 我知道您可以将命令发送到命令提示符并在后台获取输出而无需向用户显示命令提示符,但是我希望用户能够与命令提示符窗口进行交互并发送自己的命令。

Found what I needed: 找到了我需要的东西:

QProcess CommandPrompt;
QStringList Arguments;

Arguments << "/K" << "echo" << "hello";
CommandPrompt.startDetached("cmd",Arguments);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM