title: How to add non compilable configuration file into QT Project?
body: <p>I have a .txt file in QT project, where I store settings parameters for my app. If I read it that way</p>
  
  <pre><code>void MainWindow::ReadApplicationSettings()
  {
     QFile cfgFile("config.txt");
     if(!cfgFile.exists())
     {
        qDebug() &lt;&lt; "Cannot find config file.";
     }
     else
     {
        ParseConfigFile(cfgFile);
        SetCfg();
     }
     cfgFile.close();
  }
  </code></pre>
  
  <p>And Parse it:</p>
  
  <pre><code>void MainWindow::ParseConfigFile(QFile &amp;cfgFile)
  {
      QString line;
      if (cfgFile.open(QIODevice::ReadOnly | QIODevice::Text))
      {
         QTextStream stream(&amp;cfgFile);
         while (!stream.atEnd())
         {
            line = stream.readLine();
            std::istringstream iss(line.toStdString());
            std::string id, eq, val;
            bool error = false;
  
            if (!(iss &gt;&gt; id))
            {
              error = true;
            }  
            else if (id[0] == '#')
            {
              continue;
            }
            else if (!(iss &gt;&gt; eq &gt;&gt; val &gt;&gt; std::ws) || eq != "=" || iss.get() != EOF)
            {
              error = true;
            }
            if (error) { throw std::runtime_error("Parse error"); }
  
            cfgMap[id] = std::stoi(val);
       }
     }
  }
  </code></pre>
  
  <p>The file exists and when the parsing begin the content of the file is empty </p>
  
  <blockquote>
    <p>The result of: line = stream.readLine(); is "".</p>
  </blockquote>
  
  <p>If I add the file like a resource file and opened this way:</p>
  
  <blockquote>
  <pre><code>QFile cfgFile(":config.txt");
  </code></pre>
  </blockquote>
  
  <p>It's working correct, but the problem is that <strong>the config file is compiled</strong> and when you have to change some value, <strong>the project must be rebuild to take effect</strong></p>
  
  <p>I tried to compose the path like that <code>QDir::currentPath + "/config.txt"</code>, but not working as well.</p>