title: Backslash or Forward Slash in Qt?
body: <p>I'm trying to open a file in Qt.I used double back slash in this function</p>
  
  <pre><code>doc-&gt;dynamicCall("Open(QVariant)", "E:\\QT\\build-untitled-Desktop_Qt_5_7_0_MSVC2015_64bit-Debug\\My Question.doc")
  </code></pre>
  
  <p>and it works. However, my directory variable's absolute path returns this, which has forward slash:</p>
  
  <pre><code>"E:/QT/build-untitled-Desktop_Qt_5_7_0_MSVC2015_64bit-Debug/My Question.doc"
  </code></pre>
  
  <p>and It doesn't work. Error says: " Sorry, we couldn't find your file. Is it possible it was moved, renamed or deleted?" I tried everything and it only works with double back slash.</p>
  
  <p><a href="https://i.stack.imgur.com/A0efp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/A0efp.png" alt="enter image description here"></a></p>
  
  <p>I do know that I have to escape <code>\</code> as <code>\\</code>, but how do I write this function using my variable ?</p>