title: How to find the installation directory of a Qt application?
body: <p>I have a Qt based application that works for both Mac and Windows.  When the user installs the software it also installs a folder containing a bunch of HTML documentation pages. How I can find the location of the program's installation so that when the user tries to open Help from within the application, they're brought to <code>index.html</code>.</p>
  
  <p>My program installs in the normal locations for Windows and Mac.  On Mac, my program installs to <code>/Users/username/Applications/MyProgram</code> where <code>MyProgram</code> is a folder containing "MyProgram.app" and the "Doc" folder.</p>
  
  <pre><code>#ifdef Q_OS_MACX
      docPath = executablePath + "/Doc/index.html";
  #elif Q_OS_WIN
      docPath = executablePath + "/Doc/index.html";
  #endif
  
      QDesktopServices::openUrl(QUrl::fromLocalFile(docPath));
  </code></pre>
  
  <p>So, my ultimate question is, what should <code>executablePath</code> be?  Further, this assumes the user could install the program elsewhere besides the default location or that the program could be launched from a shortcut.</p>