title: Qt5 Change Softlink of Currently Running Executable
body: <p>I created 2 simple Qt5.5 test apps on Linux, "red" and "green". I setup an initial soft link in the current directory that looks like this: </p>
  
  <pre><code>gui -&gt; red
  </code></pre>
  
  <p>I want to be able to launch the gui app at any time and have it switch the softlink to the other 'color' app. So when I run gui and it points to red, the next time I run gui it will point to green.</p>
  
  <p>The red app code to do this looks like this:</p>
  
  <pre><code>MainWindow::MainWindow(QWidget *parent) :
      QMainWindow(parent)
  {
      // Get the current path
      QString cwd = QDir::currentPath();
      qDebug() &lt;&lt; cwd + "/green";
      bool success = QFile::link(cwd + "/green",cwd + "/gui");
      qDebug() &lt;&lt; "Was successful: " &lt;&lt; success;
  }
  </code></pre>
  
  <p>The green app code to do this looks like this:</p>
  
  <pre><code>MainWindow::MainWindow(QWidget *parent) :
      QMainWindow(parent)
  {
      // Get the current path
      QString cwd = QDir::currentPath();
      qDebug() &lt;&lt; cwd + "/red";
      bool success = QFile::link(cwd + "/red",cwd + "/gui");
      qDebug() &lt;&lt; "Was successful: " &lt;&lt; success;
  }
  </code></pre>
  
  <p>The problem is that the "success" boolean always fails. I guess I cannot change the soft link of a currently running process. How can I achieve this?</p>