'Set the environment on the QProcess.'

def _set_environment(self, environ):

    if environ:
        q_environ = self._process.processEnvironment()
        for (k, v) in environ.items():
            q_environ.insert(k, v)
        self._process.setProcessEnvironment(q_environ)
