title: QSqlQuery, bind a null when QLineEdit is empty
body: <p>I'm working on a database application and need to write a <code>NULL</code> value to the database when a <code>QLinEdit</code> is empty (as opposed to a white space which seems to be the default behavior). </p>
  
  <p>The following code is close to working, though it always writes <code>NULL</code>'s to the database, even when a <code>QLinEdit</code> is contains a text string. Any help is greatly appreciated!</p>
  
  <p>Example Code:</p>
  
  <pre><code>QSqlQuery qry;
  
  qry.prepare("insert into [DB] (BUSN_MNGR) values (:BUSN_MNGR)");
  
  QString BUSN_MNGR;
  
  BUSN_MNGR=ui-&gt;txt_BUSN_MNGR-&gt;text();
  
  qry.bindValue("BUSN_MNGR", BUSN_MNGR.isEmpty() ? QVariant(QVariant::String): BUSN_MNGR);  // bind null if the string is empty
  
  qry.exec .... etc. 
  </code></pre>
  
  <p>For some reason only <code>NULLs</code> are passed to the database. </p>