title: QSqlQuery inserting QByteArray as string into PostgreSQL
body: <p>I have a PostgreSQL 9.4.5 table with a column with basic character data type, i.e. created like so:</p>
  
  <pre><code>CREATE TABLE films (
      code        char(5) CONSTRAINT firstkey PRIMARY KEY,
      title       varchar(40) NOT NULL);
  </code></pre>
  
  <p>I then insert data using QSqlQuery, using a bound QByteArray:</p>
  
  <pre><code>QSqlQuery query;
  query.prepare("INSERT INTO films VALUES (1, ?)");
  const QByteArray film("Avatar");
  query.addBindValue(film);
  query.exec();
  </code></pre>
  
  <p>On Ubuntu 15.10, the film name goes into the table as bytes:</p>
  
  <pre><code>\x417661746172
  </code></pre>
  
  <p>On Windows, it goes in as characters.</p>
  
  <p>Without explicitly casting the QByteArray to QString, is there any way to tell QSqlQuery or PostgreSQL to treat the data as a string, so it works on Ubuntu as it does on Windows?</p>