My Qt application, which calls ffmpeg, is working great on Linux.

It works on OS X as long as I launch it from a Terminal, but not if I launch it from the desktop; so obviously from the GUI launcher it's not inheriting the appropriate environment.

So I'm trying to utilize QProcess systemEnvironment

The Qt docs gives this Windows-ian example:

Qt Code:
  1. QProcess process;
  2. QStringList env = QProcess::systemEnvironment();
  3. env << "TMPDIR=C:\\MyApp\\temp"; // Add an environment variable
  4. env.replaceInStrings(QRegExp("^PATH=(.*)", Qt::CaseInsensitive), "PATH=\\1;C:\\Bin");
  5. process.setEnvironment(env);
  6. process.start("myapp");
To copy to clipboard, switch view to plain text mode 

Which I assume I would adapt like this:

Qt Code:
  1. void startProcess()
  2. {
  3. QProcess process;
  4. QStringList env = QProcess::systemEnvironment();
  5. env << ":/usr/local/bin"; // Add the bin dir to PATH
  6. process.setEnvironment(env);
  7. process.start("????");
To copy to clipboard, switch view to plain text mode 

My three questions:
1. I am not sure if I am adding /usr/local/bin to PATH or not. I think I am.
2. What exactly am I satarting with process.start ? main? mainwindow.cpp ? what is it asking for here?
3. Also, am I right to be placing that block of code in main.cpp above int main or is there a better place for it.

Thanks in advance. Qt is amazing so far!