Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在制作一个 QT 移动应用程序(Sailfish Os,它是用 Linux 制作的),我需要使用只能使用命令行/终端运行的命令运行一些进程。我可以使用 QT/C++ 代码来做到这一点,还是我在谈论不可能的事情?:)
是的,有可能,您可以使用 QProcess 在 Qt 应用程序中运行 Linux 命令。这是一个小例子:
QProcess *system_command = new QProcess(); system_command->start("/bin/bash"); system_command->waitForFinished(500); system_command->write("ls -a\n");