launch GUI app from QProcess

感情迁移 提交于 2019-12-24 10:28:26

问题


I want to launch GUI app using QProcess.

process.start() return immediately without showing GUI app window.

I also tried CONFIG += console .It didn't work.

QProcess process;
process.setEnvironment(QProcess::systemEnvironment());
process.start("pkexec --user root ",QStringList()<<QString("apt-get install xyz"));
process.waitForFinished();
process.close();

回答1:


Try

process.start("pkexec", QStringList() << "--user" << "root" << "apt-get" << "install" << "xyz");


来源:https://stackoverflow.com/questions/6258565/launch-gui-app-from-qprocess

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