launch GUI app from QProcess
问题 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