开发者

launch GUI app from QProcess

开发者 https://www.devze.com 2023-03-11 07:54 出处:网络
I want to launch GUI app using QProcess. process.start() return immediately without showing GUI app window.

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();


Try

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

精彩评论

暂无评论...
验证码 换一张
取 消