title: Converting QString to std::string
body: <p>I've seen several other posts about converting QString to std::string, and it should be simple. But somehow I'm getting an error.</p>
  
  <p>My code is compiled into a VS project using cmake (I'm using VS express), so there's no issue with the QT libraries, and the GUI that I wrote works besides this part.</p>
  
  <p>I have a <code>QComboBox cb</code> that holds the names to some objects, and a <code>QLineEdit lineEdit</code> that allows me to specify the name of the object that I am looking for. It should run a function that is tested and working when I press a go button, with the input from the <code>QComboBox</code> and the <code>lineEdit</code> as arguments.</p>
  
  <p>Here's the code for when the go button is clicked:</p>
  
  <pre><code>void gui::on_go_clicked(){
      std::string str(cb-&gt;currentText().toStdString());
      //std::cout &lt;&lt; str &lt;&lt; "\n";
      //QString qstr = lineEdit-&gt;text();
      //std::cout&lt;&lt;lineEdit-&gt;text().toStdString();
      updateDB(str, lineEdit-&gt;text().toStdString());
  }
  </code></pre>
  
  <p>The first line, creating <code>str</code>, works fine. I.E. there's no problem with library functions or <code>toStdString()</code>. But when it executes my function, the program breaks, and it's not becuase of the function, it's because of the part where it tries to convert <code>lineEdit-&gt;text().toStdString()</code>.</p>
  
  <p>This is only when I write the word "test" in the <code>lineEdit</code> box. I've seen other answers talking about unicode, which I tried briefly, but I can assume that the user will not be putting any special characters in the <code>lineEdit</code> box, barring '_' and '.', which shouldn't be unicode.</p>