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 应用程序(App1)。我想从另一个 qt 应用程序(App2)运行 App1。我试过使用 QProcess 但 App1 没有运行。请帮帮我。我正在研究 RHEL 6。
QProcess process = new QProcess(); QString program = "/home/user1/Desktop/MyApp/App1"; process->start(program);
试试这个:
int exitCode = QProcess::execute(program); qDebug("Exit code is: %d.", exitCode);
并检查会发生什么。这是一个同步调用。在您了解发生了什么之后,如果需要,请将其更改回异步。
QProcess *p= new QProcess(this); p->start("yourotherapp.exe",QIODevice::ReadWrite);