title: In Qt, what are the different ways to set an environment variable and what are the pros & cons?
body: <p>Specifically:</p>
  
  <ul>
  <li><strong>What are all the different ways I can set an environment variable?</strong> <em>I know about <code>qputenv</code>. What about <code>qmake</code> and the <code>.pro</code> file? What about Qt Creator build settings? What about commands like <code>QGuiApplication::setAttribute(Qt::AA_UseOpenGLES);</code>? Are there other ways too? Please include any restrictions (e.g. <code>qputenv</code> must be used before instantiating the <code>QApplication</code> within <code>main.cpp</code>)</em></li>
  <li><strong>What are the pros and cons of each approach?</strong></li>
  <li><strong>For each approach, can you give an example setting the variable to:</strong>
  
  <ul>
  <li>an integer</li>
  <li>a string</li>
  <li>another environment variable</li>
  </ul></li>
  </ul>