天天看点

Qt如何读取windows系统环境变量

方法1:

QString path = QProcessEnvironment::systemEnvironment().value("PATH")

方法2:

QStringList environment = QProcess::systemEnvironment();

QString str; foreach(str,environment)

{

     if (str.startsWith("PATH="))

     {

         ui.textEdit->append(str);

         break;

     }

 }

Qt

继续阅读